📅  最后修改于: 2022-03-11 15:03:54.858000             🧑  作者: Mango
//here is how to get an array from the length of a number
// for example you want to get [1,2,3,4,5] from the integer 5.
let arr = []
let i = 5
for (let j = 0 ; j < i + 1 ; j++ ) {
arr.push(j)
}