如何理解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})返回的结果是一样的,为
[[object Object] {
length: 5
}]
第二、三还能理解!第一种怎么理解?
首先需要有个 函数,定义个 iAmArray;
一周热门 更多>