Multiple choice technology

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

  1. msgBox("Hello World")

  2. alertBox="Hello World"

  3. alertBox("Hello World")

  4. alert("Hello World")

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

The alert() function is the correct JavaScript method for displaying an alert box with a message. Options A, B, and C use non-existent functions (msgBox, alertBox) that are not part of JavaScript.