Skip to main content

JavaScript Question 84

Question 84 of 0JavaScript

What is the output?

Login Required

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

Code:
function checkAge(age) {
  if (age < 18) {
    const message = "Sorry, you're too young.";
  } else {
    const message = "Yay! You're old enough!";
  }
  
  return message;
}

console.log(checkAge(21));

Select the correct option: