JavaScript “console” Object Hacks part 2

This is my second blog on this topic and in this we will talk in some advance topic which are lesser known (I think) by beginners.

  1. count ⇾ it places a counter on the object value provided as argument. Each time value is appeared in count, counting is increased (“exception is empty string which do not contains label”).
[label] : X 
Output for count

2. trace ⇾ it outputs the current stack trace or display the same output as console.log if invoked in the global scope. This method is very useful in tracing the recursion.

Output of the trace method
                              Bonus Method time ⇾ console.time can be used to measure how long a task took, it start a new timer identified by label which is accepted through argument.timeEnd ⇾ it shows the elapsed time in millisecond for that label.  We may use it to notice the execution time of an algorithm. timeEnd takes same label as argument which time took.
Output of time and timeEnd
Thanks a lot to read till last, leave a clap and relevant comment.

I am programmer and web developer who loves to teach