We can see an immediate result of our code on the console. Also, we can send errors, warnings, and info too.
Here is how to do that
To open the console on the browser open a new tab. After that, right-click to mouse and click on inspect element. You can do it using a keyboard. The shortcut for mac is command + shift + del, for windows ctrl + shift + del.
We can see the result using a log. code is – console.log(” Hello World”);
We can send error:
console.error(" Its is an error");
To send warning code is –
console.warn("This is a warning");
We can show object results using a table,
Also, you can set time on a particular code so that you can check how much time it takes to run the code.
The starting is
Your code here …
then the ending time
To clear console the code is :
That all from me for the console.