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