Photo by Boitumelo Phetla on Unsplash

JavaScript console is a command line interface that is used in your browser that executes snippets of code. It is highly useful in finding errors in your code in an attempt to debug them. I have used it plenty of times to test my code to see whether or not I was receiving the right data that I was calling within a fetch method to a specific API. It can also be used to view specific changes to variables, states, and messages to make sure your program is working as expected. Recently I have been using them in learning algorithms and data structures to make sure I am implementing the right code to get the desired end result. You can use them in numerous ways in the JavaScript console. Here are some ways you can use the console.

These are the directions to open the console depending on your browser.

Firefox: Menu Bar > Tools > Web Developer > Web Console

Chrome: Customize and Control Google Chrome > More Tools > Developer Tools

Safari: Safari Menu > Preferences > Advanced > Checkbox “Show Develop Menu” > Develop Menu > Show Error Console

It should look like so…

Now there are many different ways you can use the console. Mostly the ways that are extremely new to me because for the most part all I ever knew was “console.log()”.

  1. Console.log()

Outputs a message to the console…

2. Console.warn()

Outputs a warning message to the console…

3. Console.error()

Outputs an error message to the console…

4. Console.clear()

Clears the console…before…

after….

5. Console.count()

Logs the number of times that this particular call to count() has been called…

6. Count.table()

Displays tabular data as a table…

7. Console.time() & Console.timeEnd()

Starts and stops a timer…

8. Console.group() & Console.groupEnd()

Creates a new inline group in the console…

There are more console methods you can use these are just a few I thought were pretty cool. Below are my resources. Thank you for reading!!!!

--

--

--

Software Engineering creative with background in architectural design. Love for sustainable design and tech!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Context API a different approach to have a global state

3-Move the Player at “Light Speed” and “Normal Speed”

RelayHooks vs. RelayContainers

How to Scroll Web Pages Using TestCafe

Lombok constructor annotations

How to Implement Infinite Scroll with Vanilla JavaScript

React job interview questionnaire cheatsheet

Week 1 - Summary of Fastest JavaScript Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Johnnie Gonzalez

Johnnie Gonzalez

Software Engineering creative with background in architectural design. Love for sustainable design and tech!

More from Medium

function borrowing ,apply() and bind() method in JavaScript by Paras Manavdariya

4 Ways to Handle Async Operations in Javascript

4 Ways to Handle Async Operations in Javascript

Why do not use Math.random()

Intuitive Code

An open Apple laptop, notebook, tea cup and saucer on a wooden table