29
In JavaScript Console Other Than Console.log()
Let assume you want to keep a count of how many click the user makes on the button. The code with .log() might look like this
let userClickCounter = 0;
function watchUserClicks(){
userClickCounter++;
console.log("User Clicked ${userClickCounter}")
}
<button onclick = "watchUserClicks()">
Click Me to Without pause
</button>
The other method is also present
function watchUserClick(){
consol.count('User Click');
}
<button onclick = "watchUserClicks()">
Click Me to Without pause
</button>
Here the need for variable and its related code is eliminated thereby, making the code optimal and readable.
This method shows all the properties of the JS Object.
The console.log() print out toString representation whereas consol.dir() print out a navigation tree
The console.log() print out toString representation whereas consol.dir() print out a navigation tree
see the difference:-

When you are working on a complex algorithm. time is one of the main factor you need to look on simultaneously.
29