var c = {
name: 'The c object',
log: function() {
this.name = 'Updated c object';
console.log(this);
var setname = function(newname) {
this.name = newname;
console.log(this);
}
setname('Updated again! The c object');
console.log(this);
}
}
c.log();
第二个console.log为什么是指向window???
相关分类