Discussion
Which of the following is a valid JavaScript function to output "Hello, World!" to the console ?
Answer: C
The valid function is console.log("Hello, World!").
In JavaScript, console.log() writes a message to the browser's or Node.js console, and is the standard way to print debugging output.
console.print, log.console and alert.console do not exist. (alert() on its own shows a pop-up box, not console output.)
Related methods are console.error() and console.warn(), which write error and warning messages.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development