之后
console.log(myvar())
我希望看到“ george”,因为我希望函数能够被执行。我在这里想念什么?
var person = {
name: "george",
getName: function ()
{
return this.name;
},
numbers: [7, 11, 41]
};
myvar = person.getName;
console.log(myvar); //prints function as a string as expected
console.log(myvar()); //