1.
1function test(){
3    alert(arguments.length);//实参的数目
4     alert(test.length);//行参的数目
5}
2.callee返回当前方法的引用
1function test(){
3    alert(arguments.callee.length);//行参的数目
4     //arguments.callee返回当前方法的引用,所以
5     //arguments.callee == test
6    //所以实际上仍然伪test.length
7}
3.call(),apply()
call()传递单个参数,apply()参数传递为数组参数
1var Class = {
2  create: function() {
3    return function() {
4      this.initialize.apply(this, arguments);
5    }

6  }

7}

8

 1var vehicle=Class.create();//vehicle为一个方法,所以可以有prototype属性。返回的是一个构造函数。
 3vehicle.prototype={
 4    initialize:function(type){//这个方法在创建vihicle的对象的时候被调用
 5        this.type=type;
 6    }

 7    showSelf:function(){
 8        alert("this vehicle is "+ this.type);
 9    }

10}

11
12var moto=new vehicle("Moto");
13moto.showSelf();
14