有人可以向我解释为什么alert.length
返回“ 0”,为什么Array.length
或Object.length
返回“ 1”
console.log('alert.length: ' + alert.length); // 0
console.log('Array.length: ' + Array.length); // 1
console.log('Object.length ' + Object.length); // 1
console.log('String.length: ' + String.length); // 1
/* as you see can anyone of you explain me why this works this way */
有人可以向我解释一下。 ECMAScript specification]中提到了此行为吗?
有人可以向我解释为什么alert.length返回“ 0”以及Array.length或Object.length为什么返回“ 1” console.log('alert.length:'+ alert.length); // 0 console.log('Array.length:'+ ...
length属性指示函数期望的参数数量。