12. Using console.log


What does console.log do?

It seems to display the output of script.js but sometimes, even without console.log, there is still a display.


console.log displays a text, number or boolean in the console. You can access the console of your browser by pressing F12 and looking for it around there (changes from browser to browser). JavaScript is used for websites so probably console is used only for displaying an error, or stuff that the programmer considers useful. If you want to make a website and write something there are other ways. I must say I haven't learnt them all but you can find them easily. The syntax for console.log is the next.
console.log("The string you want to write");
console.log(false); // you can also use true
Functions (only if the function has a return in it)

Remember to always put a ; at the end of it. Hope it helps