The console.log() method is very important while testing and writing code. Because most of the time we use the console.log() method to understand other developers’ code. The console.log() method is used to write logs / a message to the web console. This method is used for testing purposes. We can use any data type inside the log() method, whether it is a string, array, object, boolean, etc.
- message – This parameter contains the message to write to the web console.
Output: Press F12 and go to the Console section