Guest User

Untitled

a guest
Mar 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // function* fib(n) {
  2. // let [a, b] = [1, 0]
  3.  
  4. // for (let i = a; i < n; i++) {
  5. // b = a + b
  6. // a = b - a
  7. // yield a
  8. // }
  9. // }
  10.  
  11. // for (let n of fib(10)) {
  12. // console.log(n)
  13. // }
  14.  
  15.  
  16. function fibber() {
  17. let [a, b] = [1, 0]
  18.  
  19. return function() {
  20. b = a + b
  21. a = b - a
  22. console.log(a)
  23. }
  24. }
  25.  
  26. // window.setInterval(fibber(), 200)
Add Comment
Please, Sign In to add comment