Array.of() 和 Array.from()
2018-05-28 本文已影响9人
sunnyRube
let a = Array.from(3)
console.log(a) //length 为3的数组 a[0] = undefined
let b = Array.of(3)
console.log(b)//length为1的数组 b[0]=3
let a = Array.from(3)
console.log(a) //length 为3的数组 a[0] = undefined
let b = Array.of(3)
console.log(b)//length为1的数组 b[0]=3