console.log() logs user output to the console.
To see it in action, save the following code in a HTML file, then open it in Chrome.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Once in Chrome, press F12 to open the dev tools, then click the console tab.
There you should see the output of
console.log (if not, just reload the page).
Many people use
alert() for this purpose but
console.log() is easier to work with, as using an alert pop-ups up a modal dialog box that blocks the user interface.
BTW, Chrome is not the only browser to have this functionality. Check out this great tutorial to find out more: http://net.tutsplus.com/tutorials/tools-and-tips/chrome-dev-tools-markup-and-style/