This question already has an answer here:
What is console.log?
You can use it to output some information in the browser's console. Usually it is done for debugging purposes.
It is useful for printing out debugging information in the browsers console while developing. In Chrome hit Ctrl + Shift + I to open the developer tools and switch to the Console to view output.
A developer may use this to verify that a line of JS is actually being reached, ie
Console.log( "Reached Here" ); or to verify that a variable holds the value expected.
Console.log( "Value of x is: " + x );
It is also very useful if you are writing JS for the server side using Node.js. This will allow you to log requests to the server and other useful information.
Console.log should probably be limited on the client side though, IE in real websites, especially if they were used for debugging as it may reveal site vulnerabilities. I have also seen Console.log cause issues in some versions of Internet Explorer.