开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜