JavaScript: Console

Console of JavaScript:

The console is a display panel for developers that shows all the important messages such as errors, system details, etc. By default, the computer does a lot of work with our code that we can’t see on the screen. We can print or log to our console directly if we want to see things displayed on our screen.

The console keyword in JavaScript refers to an object, which is a collection of data and actions that we may use in our code. Keywords are terms embedded into the JavaScript language that the computer recognizes and treats accordingly.

The .log() method is one of the built-in methods (or actions) of the console object. Whatever we put inside the parentheses will be printed, or logged, to the consolewhen we use console.log().Printing values to the console will be very important for us so that we can see our progress.

console.log(12);

This example outputs the number 12 to the console. A semicolon marks the conclusion of a line or a statement. Although your JavaScript code will typically work without a semicolon, we encourage that you get into the habit of terminating each statement with one so that you don’t forget to use one when it’s needed.

Later on, we’ll see how to utilize console.log() to print various types of data.

Helpful Tools:

Here are some useful tools to help you along your journey!

Setting up an IDE (Integrated Development Environment) can be difficult for beginners. The Online Compiler will enable you to run your code inside your browser without the need to install an IDE. If you need a more detailed explanation of a specific topic, the best place to find answers is in the Official Documentation.

Scroll to Top
%d bloggers like this: