Created
May 15, 2019 17:46
-
-
Save luisenriquecorona/0c0c4578aeb3845a63bfd87e432ab779 to your computer and use it in GitHub Desktop.
Code for Understanding done Property
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
//get generator instance variable | |
let generatorSequenceResult = | |
generatorSequence(); | |
console.log('done value for the first time', | |
generatorSequenceResult.next()) | |
console.log('done value for the second time', | |
generatorSequenceResult.next()) | |
console.log('done value for the third time', | |
generatorSequenceResult.next()) | |
//Running this code will print the following: | |
done value for the first time { value: 'first', done: false } | |
done value for the second time { value: 'second', done: false } | |
done value for the third time { value: 'third', done: false } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment