use the console.log method to send message to console in your javascript, for example:

 console.log('Hello,my friend!')

What's more, you can use console.warn() for warn messaging, console.error() for error messaging, console.info() for infomation message, for example:

 console.warn('console is offline')
 console.error('connection failed')
 console.info('hahaha')

 
Check the differences between these three by pressing Ctrl+shift+J (windows) or Cmd+opt+J(Mac) in chrome.


Using the %c format to style the console!

console.log('%cI am styled!', '
color: #86CC00; 
background-color:yellow; 
font-size: 20px; 
padding: 3px;')
 

These are called Console API which helps you to write information to the console, create javascript profiles and start a debugging session, and there are more API to try with.



<---