Table of contents
No headings in the article.
function* gen()
{
yield 100;
let a = 100
a = a + 1
yield a;
a = 200
yield a * 2;
}
// Calling the Generator Function
var mygen = gen();
console.log(mygen.next().value);
console.log(mygen.next().value);
console.log(mygen.next().value);
Output:
100
101
400