Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // function* fib(n) {
- // let [a, b] = [1, 0]
- // for (let i = a; i < n; i++) {
- // b = a + b
- // a = b - a
- // yield a
- // }
- // }
- // for (let n of fib(10)) {
- // console.log(n)
- // }
- function fibber() {
- let [a, b] = [1, 0]
- return function() {
- b = a + b
- a = b - a
- console.log(a)
- }
- }
- // window.setInterval(fibber(), 200)
Add Comment
Please, Sign In to add comment