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* customGenerator() { | |
| yield 1; | |
| yield 2; | |
| yield 3; | |
| } | |
| var getIterator = customGenerator(); |
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* customGenerator() { | |
| yield 1; | |
| yield 2; | |
| yield 3; | |
| } | |
| var getIterator = customGenerator(); | |
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* customGenerator() { | |
| yield 1; | |
| yield 2; | |
| yield 3; | |
| } | |
| var getIterator = customGenerator(); | |
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* customGenerator() { | |
| yield 1; | |
| yield 2; | |
| yield 3; | |
| } | |
| let getIterator = customGenerator(); | |
| let firstValue = getIterator.next(); |
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* customGenerator() { | |
| yield 1; | |
| yield 2; | |
| yield 3; | |
| } | |
| let getIterator = customGenerator(); | |
| let nextValue = null; |
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* customGenerator() { | |
| yield 1; | |
| return 5; | |
| yield 2; | |
| } | |
| let getIterator = customGenerator(); |
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* customGenerator() { | |
| let x = yield 1; | |
| yield x + 1 | |
| } | |
| let getIterator = customGenerator(); | |
| let nextValue = null; |
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 normalFunction() { | |
| console.log("1"); | |
| console.log("2"); | |
| console.log("3"); | |
| console.log("4"); | |
| console.log("5"); | |
| } | |
| normalFunction(); |
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 *iterateGenerator() { | |
| yield "1"; | |
| yield "2"; | |
| yield "3"; | |
| yield "4"; | |
| yield "5"; | |
| yield "6"; | |
| } |
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* customGenerator() { | |
| yield 1; | |
| yield 2; | |
| yield 3; | |
| } | |
| let getIterator = customGenerator(); | |
| let firstValue = getIterator.next(); |