javascript 中 arguments.callee属性 可以在函数内部,指向的是这个函数(或者叫做“类”)本身. 相当于PHP 中的 self 关键字. The arguments.callee property contains the currently executing function. Description callee is a property of the arguments object. It can be used to refer to the current
一.使用构造函数获得私有属性: function Gadget(){ var name = 'iPod'; this.getName = function(){ return name; }; }; var toy = new Gadget(); console.log(toy.name);//undefined console.log(toy.getName());//iPod 注意,当返回变量为数组或对象时,私有性失效: function Gadget(){ var specs = { wi