Multiple choice technology databases

What is the correct JavaScript syntax to write "Hello World"?

  1. document.write("Hello World")

  2. "Hello World"

  3. response.write("Hello World")

  4. ("Hello World")

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

document.write() is a standard JavaScript method that outputs text directly to the HTML document stream when the page is loading. Option B is merely a string value that doesn't produce output, option C uses the ASP response object (not JavaScript), and option D is just a parenthesized string with no output mechanism.