Skip to main content

JavaScript Question 124

Question 124 of 0JavaScript

What's the output?

Login Required

Please login to select answers and solve this question. You can view the question without logging in.

Code:
async function* range(start, end) {
  for (let i = start; i <= end; i++) {
    yield Promise.resolve(i);
  }
}

(async () => {
  const gen = range(1, 3);
  for await (const item of gen) {
    console.log(item);
  }
})();

Select the correct option: