Created
December 2, 2019 16:53
-
-
Save animatedlew/ddfd939e805f1b3307757db061507d98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function *fibonocci(t) { | |
let a = 1, b = 0, c = 0; | |
while(c < t) { | |
yield c; | |
c = a + b; | |
a = b; b = c; | |
} | |
} | |
let output = Array.from(fibonocci(21), n => n * 2); | |
console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment