Array.apply(null,{length:10}).map(()=>1)
Array.from({length:10}).map(()=>1)
Array.from(arrayLike, x => x * x)
Array.from([1, 2, 3], (x) => x * x)
Array.apply(null,{length:10}).map(()=>1)
Array.from({length:10}).map(()=>1)
Array.from(arrayLike, x => x * x)
Array.from([1, 2, 3], (x) => x * x)
本文标题:数组快速生成、赋值的方法
本文链接:https://www.haomeiwen.com/subject/cpkizttx.html
网友评论