Created
March 11, 2021 12:34
-
-
Save zlatkov/b1e4739be97dd8f33aeecf47b6b86730 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
let fibonacciSequenceIterator = makeFibonacciSequenceIterator(5); // Generates the first 5 numbers. | |
let result = fibonacciSequenceIterator.next(); | |
while (!result.done) { | |
console.log(result.value); // 1 1 2 3 5 8 | |
result = fibonacciSequenceIterator.next(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment