Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function* iterator() {
- yield 1
- yield 2
- yield 3
- }
- for (const value of iterator()) {
- console.log(value)
- }
- // -->
- // 1
- // 2
- // 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement