我想在 Javascript 中使用 map() 或 reduce() 函数打印斐波那契数列。我在网上找不到任何关于它的东西。我不太确定我在 map() 中的情况。
我基本上在写
fib(n){ return new Array(n-1).fill(1).map((_,i) => *This is where I am confused* ) ; }
javascript arrays higher-order-functions
arrays ×1
higher-order-functions ×1
javascript ×1