Which of the following is a valid JavaScript function to output “Hello,…
2025
Which of the following is a valid JavaScript function to output “Hello, World!” to the console ?
- A.
console.print("Hello, World!")
- B.
log.console("Hello, World!")
- C.
console.log("Hello, World!")
- D.
alert.console("Hello, World!")
Attempted by 71 students.
Show answer & explanation
Correct answer: C
The correct answer is Option 2. JavaScript requires console.log, not log.console.