JavaScript-The Browser Console

Gerald Clark
2 min readMay 5, 2024

My default Browser is Chrome currently. I’m sure all the other ones have similar functionality, but I’ll be writing this within the context of Chrome.

If you press F12 when your broswer page is in focus it will bring up your console window on the side.

You can actually run JavaScript code within this console window.. typing out alert("YO!"); will actually make the alert pop up.

Is there a practical use for that? Not sure..but it CAN be done!

A more important use of this feature is the ability to log things to it. You can do this directly from your JavaScript file.

I used console.log() to type out a message. Saving your .js file and going back to your web browser will show this message in the console.

This can be handy when bug fixing amongst other situations we’ll cover later.

Don’t get too hung up on what all the weird lingo is right now. I’ll go over it a bit more later on. In the next article I’ll actually start diving into some basic JavaScript information without the html aspects. See ya there!

--

--