Array坑

2018-08-24  本文已影响0人  勃王

const a = new Array(10),
b = new Array(10, 9),
c = new Array(10, 9, 8)

console.log(a, b, c)
const d = Array.of(10),
e = Array.of(10, 9),
f = Array.of(10, 9, 8)

console.log(d, e, f)

稀疏数组的坑

var a = new Array(10)
number = a.map((_,index) => index)
console.log(number)
上一篇 下一篇

猜你喜欢

热点阅读