Multiple choice

How do you write "Hello World" in an alert box?

  1. alert("Hello World");

  2. msg("Hello World");

  3. alertBox("Hello World");

  4. msgBox("Hello World");

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In JavaScript, the alert() method is the standard built-in function used to display an alert box with a specified message and an OK button. The other options like msg() or msgBox() are invalid standard functions.