2

Take a look at this screenshot:

enter image description here

As you can see, the last index of this array is shown as "0.7713948369012206" in console log.

But when I expend the array in console log, the 8th index is shown as "NaN". It is effecting my code, Why it is not shown as a normal number?

My array is having thousands of object like this:

array = {"abc": [0.7279141471991091, 0.7453059204457335, 0.7978668971106029, 0.6570360524074181, 0.7549066077622528, 0.7268105740052934, 0.7351847097682157, 0.7031287738185653, 0.7713948369012206] , "dsfs": [0.1454351471991091, 0.3054449204457335, 0.9353788971106029, 0.8570360524074181, 0.5549066077622528, 0.7268105740052934, 0.6351847097682157, 0.3031287738185653, 0.3523948369012206]}

sdad
  • 55
  • 7

1 Answers1

3

Mouse over the small blue i icon in the chrome console and you'll see a tooltip that explains this behavior. The variable is being evaluated when you click the spin-down triangle. The value of the array at index 8 is being changed between when you initially console.log and when you spin-down and inspect the values.

See: Chrome js debug - two different values at the same time

Erty Seidohl
  • 4,487
  • 3
  • 33
  • 45