what is console.log in javascript

what is console.log in javascript

1 year ago 79
Nature

console.log() is a function in JavaScript that is used to print any kind of variables defined before in it or to just print any message that needs to be displayed to the user. It is a method that outputs a message to the web console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects. The console.log() method is useful for testing purposes. It is used to log (anything you pass it) to the console to be viewed by a developer, or potentially an end user for remote diagnostic purposes.

Here are some key points about console.log():

  • It accepts a parameter that can be an array, an object, or any message.
  • It returns the value of the parameter given.
  • It is only available in Firefox with Firebug and in Webkit based browsers (Chrome and Safari) .
  • It should be used in code only during development and debugging.
Read Entire Article