Last active
March 20, 2021 12:40
-
-
Save ashwinkumar2438/ff13a83683725f4e0e5538f5e3c1882f 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* GenIterator(i=0,counts=10){ | |
let endpoint=i+counts; | |
while(i<endpoint){ | |
yield i++; | |
} | |
} | |
console.log([...GenIterator(24,7)]) // @returns : [24, 25, 26, 27, 28, 29, 30] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment