31.
What is the purpose of console.log() in JavaScript?
To print text on the webpage
To display a message in the browser console
To create a popup window with a message
To define a new variable
Correct: B
The console.log() function is used to display a message or value in the browser console. It is commonly used for debugging and logging information during development. This function does not print anything directly on the webpage or create popup windows.