Skip to main content

JavaScript Question 71

Question 71 of 0JavaScript

How can we log the values that are commented out after the console.log statement?

Login Required

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

Code:
function* startGame() {
  const answer = yield 'Do you love JavaScript?';
  if (answer !== 'Yes') {
    return "Oh wow... Guess we're done here";
  }
  return 'JavaScript loves you back ❤️';
}

const game = startGame();
console.log(/* 1 */); // Do you love JavaScript?
console.log(/* 2 */); // JavaScript loves you back ❤️

Select the correct option: