标签:对象 logs 嵌套 his sharp highlight function console var
var obj = { foo: "hi", f1: function() { function f2(that) { console.log(that); } f2(this.foo); } }; obj.f1(); // hi Function.prototype.foo = "hello"; Function.prototype.f = function() { var that = this; setTimeout(function(that){ console.log(that.foo); }, 100, that); } Function.prototype.f(); // hello
标签:对象 logs 嵌套 his sharp highlight function console var
原文地址:http://www.cnblogs.com/ax-null/p/6784208.html