有人能解释一下为什么 alert.length returns “0” 以及为什么 Array.length 或 Object.length returns 1
can someone explain me why alert.length returns "0" and why Array.length or Object.length returns 1
有人可以向我解释为什么 alert.length
returns “0” 以及为什么 Array.length
或 Object.length
returns “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
中是否提到了这种行为
长度属性表示函数期望的参数个数。
只需完成https://tc39.es/ecma262/#sec-array-len
为什么你在 alert.length 中得到零
https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert
有人可以向我解释为什么 alert.length
returns “0” 以及为什么 Array.length
或 Object.length
returns “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
中是否提到了这种行为长度属性表示函数期望的参数个数。
只需完成https://tc39.es/ecma262/#sec-array-len
为什么你在 alert.length 中得到零 https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert