题解 | #创建数组#
创建数组
https://www.nowcoder.com/practice/04a6204cd4cf42dd8983c000110ada7e
可以用递归算法
const arr = [] let count = number const pushNumber = () => { if (count > 0) { arr.push(number) count-- pushNumber() } } pushNumber() return arr
创建数组
https://www.nowcoder.com/practice/04a6204cd4cf42dd8983c000110ada7e
const arr = [] let count = number const pushNumber = () => { if (count > 0) { arr.push(number) count-- pushNumber() } } pushNumber() return arr
相关推荐