pcoder
pcoder

Reputation: 411

What is the number beside console log in Firefox/Chrome?

I had put some logs in javascript to check the occurrence of drawElement in WebGL Code. I get drawElement on console but along with it I was also getting some number in firefox as well as chrome. What does that number signify?

enter image description here

Upvotes: 2

Views: 3372

Answers (1)

Venkat
Venkat

Reputation: 2579

It denotes The Number of times the statement is printed.

If a same statement is printed multiple times , The number will be shown instead of printing multiple times. The file name from where it is printed is shown next to it.

Sample Code :

for(var i = 0 ; i< 5; i++)
{
   console.log("Print");
   // The Same statement will be printed 5 Times
}
for(var i = 0 ; i< 5; i++)
{
   console.log(i);
  // Different values for i will be printed in every iteration like 1,2,3.
}

JsFiddle Link :

https://jsfiddle.net/19ng1p8p/

Upvotes: 2

Related Questions