var fullname = 'John Doe';
var obj = {
fullname: 'Colin Ihrig',
prop: {
fullname: 'Aurelio De Rosa',
getFullname: function() {
return this.fullname;
}
}
};
var test = obj.prop.getFullname;
console.log(test());
让控制台出现Aurelio De Rosa,,apply和call,var that=this这3中方法可以吗?用这3种方式具体该怎么写?除了apply和call,var that=this,还有其他的方式吗?求解。谢谢大家
1)
2)
3)
4)