Last active
October 21, 2017 12:01
-
-
Save sanketmeghani/98e9bb204db6336a621b2a2d1aebf0bd to your computer and use it in GitHub Desktop.
ES6 Generator Function
This file contains 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* myFirstGenerator(a) { | |
console.log('Before yielding'); | |
let b = 5 + (yield(a + 5)); | |
console.log('After yielding'); | |
return b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment