Function对象length属性
函数属于引用类型,所以它们也有属性和方法。 ECMAScript 定义的属性 length 声明了函数期望的参数个数。
function doAdd(iNum) {
alert(iNum + 10);
}
function sayHi() {
alert("Hi");
}
alert(doAdd.length); //定义了一个参数,输出 "1"
alert(sayHi.length); //没有定义参数,输出 "0"
*ECMAScript 可以接受任意多个参数(最多 25 个)
http://www.cnblogs.com/huc87/archive/2009/04/09/1432735.html