- 博客(1)
- 收藏
- 关注
原创 JS基于Generator的斐波那契数列
function* fibonaqi() { let [prev, next] = [0,1]; for(;???? { [prev,next] = [next,prev + next]; yield next; } } for(let item of fibonaqi()) { if(item > 1000) { break; } console.log(item); }
2021-11-28 09:58:14
212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人