Which of the following is used to output data to the browser console in JavaScript?

Which of the following is used to output data to the browser console in JavaScript?

a) console.output()
b) console.log()
c) output.console()
d) browser.log()

Answer:

b) console.log()

Explanation:

To output data to the browser’s console, you use the console.log() method in JavaScript. This is useful for debugging and displaying information during development.

Example:


console.log("Hello, World!");
    

Reference:

JavaScript MCQ (Multiple-Choice Questions)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top