Question from the Node.js test

Write a NodeJS code that uses the ES2015 specification.

Medium

What will be the output of the console.log?
The following code implements the ES2015 specification

var reallyWeirdGenerator = function* (index) {
  yield index++;
  yield index + 5;
  yield index;
};

var iterator = reallyWeirdGenerator(0);
iterator.next();
iterator.next();
iterator.next();
console.log(iterator.next().done);
Author: Jean-marie CléryStatus: PublishedQuestion passed 791 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!