Advertisement
728x90
javascript
1const myGenerator = (function* () {
2
3yield 1;
4
5yield 2;
6
7yield 3;
8})();
9
10for (const value of myGenerator) {
11
12console.log(value);
13
14break;
15}
16
17for (const value of myGenerator) {
18
19console.log(value);
20}Choose the correct output:
A
1,2,3 and 1,2,3B
1,2,3 and 4,5,6C
1 and 1D
1Advertisement
Responsive Ad
46of86