var foo = { bar: function() { return this.baz; }, baz: 1 }; (function(){ return typeof arguments[0](); })(foo.bar);
Why does this c
this refer to bar function itself.
var foo = { bar: function() {return foo.baz; }, baz:1 }; (function(){ return typeof arguments[0](); })(foo.bar);
fiddle : http://jsfiddle.net/W9Jqb/