Here, we will show you how to access and use the Console API,
Given below figure shows the Google Chrome Developer Tools Console,
From the above code, the resultant will be true. Although, the variable A contains the value 10, the Console will return the text true.
Sometimes, we would be dealing with an Array of data or a list of Objects, as shown below,
Difficult to read the data using console.log() method. The console.log() method will display the Array in the console tree, as shown in the figure below,
The above Array method with console.table() is a good way to present output in a table format. For that, just take all above data, the output will display like the given below figure,
The browser’s in-built tool is very much helpful for developers to handle errors comes with websites, also helpful to test data output in the table with the help of console.log() and console.table() array command. Table displays Array that is easy to read. The console.table()command is only valid in Webkit-based browsers, such as; Chrome, Safari, etc…