如何理解Array.apply(null, {length:5})的{length:5}?
我測試過
Array.apply(null, {length:5})//返回[undefined, undefined, undefined, undefined, undefined]
Array.apply(null, [{length:5}])和Array({length:5})返回的結(jié)果是一樣的,為
[[object Object] {
length: 5
}]
第二、三還能理解!第一種怎么理解?