Array坑

作者: 勃王 | 来源:发表于2018-08-24 11:36 被阅读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)

相关文章

网友评论

      本文标题:Array坑

      本文链接:https://www.haomeiwen.com/subject/cpdviftx.html