Created
June 2, 2018 12:13
-
-
Save dg92/c7c4c6028a25f3610d14096ae1b9b962 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
const range = { | |
start: 1, | |
end: 5, | |
[Symbol.iterator]() { | |
this.current = this.start; | |
return this; | |
}, | |
next() { | |
if (this.current <= this.end) { | |
return { done: false, value: this.current++ }; | |
} else { | |
return { done: true }; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment