Setting/Getting propertiles of function objects in JavaScript
How can I access properties of function objects.
Consider, how to make this example work:
var foo = function(){
print(this.value);
};
foo.value=20;
开发者_如何学JAVA foo();
var foo = function(){
print(foo.value);
};
Refer the function directly, In theory you can use arguments.callee.value
but that's deprecated and you shouldn't use it.
精彩评论