例子:
function SomeCall(){
return "Bill";
}
var a = [];
a.push(SomeCall());
var obj = {
name: SomeCall()
};
//is function CALLED here or does this already contain "Bill"?
console.log(obj.name);
console.log(a[0]); //what about here?
现在,当我访问数组中的对象或项的值时,它是否在那时调用该函数并给我该值?还是在推送/赋值时调用函数并保存返回值?