Array坑

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)

你可能感兴趣的:(Array坑)