针对JavaScript里的arguments对象有如下问题
1.是Array类型的吗?它有哪些属性?
// Best practices: it is best not to use argumentsfunction test(){ console.log( arguments instanceof Array);//return false arguments is not a instance of Array console.log([1,2] instanceof Array);// return true console.log( arguments.length); // ok}test(); console.log({}.length); //undefined
结论: arguments是一个特别的Object, 它带了一个length属性