Javascript console messages

Most modern browsers include Developer tools which helps developers analyze client html and scripts. To write something from Javascript to console below options are available.

Error
gives you the red error message
console.error(message);

Default
gives the default message
console.log(message);

Warning
gives the warning message with the exclamation mark in front of it
console.warn(message);

Information
gives an info message with an ‘i’ in front of the message
console.info(message);

Leave a Reply

Your email address will not be published.