Working with console in JavaScript

For the convenience of programmers, each browser has a special developer panel. You need to right-click anywhere on the current site page to open this panel. In the menu appeared, you need to select the lowest item (it will be called Inspect or something like that).

In the panel that opens, you will mainly use two tabs: Elements and Console. In the first tab you can get information about page tags and in the second one JavaScript debug information.

Let's understand the possibilities of the console.

With your scripts you can output data to the console, using the special command console.log. This is used to debug programs.

As an example, let's output something to the console:

console.log(123);

Now let's output the variable value:

let num = 123; console.log(num);

You can output multiple variables in turn:

let num1 = 123; let num2 = 456; console.log(num1); console.log(num2);

You can display multiple variables with single command by writing these variables separated by commas:

let num1 = 123; let num2 = 456; console.log(num1, num2);

Given a variable. Output its value to the console .

Three variables are given. Output their values to the console.

enru