Displaying Log And Error Log In VS Code

We have been printing console.log() and console.error() in javascripts and using it for browser debugging, for a very long time. Now, with Visual Studio Code, we can use the same function to get an easier way to look up the Log text and Error text in Debug Window.

The usage is simple. When we need to write log message, we use the following code: 
  1. console.log("This is log message");  
This gives the output, as shown below:
 
 
 
Now, in order to get the error log message, we use the following code: 
  1. console.error("This is error message");  
 
 
The error message is displayed in red color while the simple log message is displayed in white color. This feature gives a bit of clarity when an error occurs and makes the job of the developer easier.
Ebook Download
View all
Learn
View all