JS Coding Questions Logo
JS Coding Questions
#45🎯 Exercise💻 Code

JavaScript Coding Exercise 45

Advertisement

728x90
javascript
1function* myGenFunc() {
2
3yield 1;
4
5yield 2;
6
7yield 3;
8}
9
10var myGenObj = new myGenFunc();
11
12console.log(myGenObj.next().value);

Choose the correct output:

A
1
B
undefined
C
SyntaxError
D
TypeError

Advertisement

Responsive Ad
44of86