Created
June 28, 2020 18:35
-
-
Save Alamin02/8ad68742df18d8271127983036c427f8 to your computer and use it in GitHub Desktop.
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* makeEvenNumberIterator(start, end) { | |
const sequence = []; | |
const firstValue = start % 2 === 0 ? start: start + 1; | |
for (i = firstValue; i <= end; i = i + 2) { | |
yield i; | |
} | |
return sequence; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment