Skip to content

JS中算法

使用js生成1-10000的数组

js
// 方法一
Array.from(new Array(10001).keys()).slice(1)

// 方法二
Array.from({length:10000},(node,i)=> i+1)