Skip to content Skip to sidebar Skip to footer

Chrome Devtools - Inconsistent Array Length

I seem to have stumbled upon an inconsistency in Chrome DevTools. Above is a screenshot from the DevTools. At first, I am told that the printed object contains a Body and a Head.

Solution 1:

This is because the initial display, the one with this format:

Object {Body: Array[20], Head: Array[1]}

Is generated when the console first logs it. After expanding, it loads all of the object's properties, and if the properties have changed in between logging it and opening it, it will show different values.

You can hover over the light-blue i that shows behind the object to see what Chrome says about this itself.

Post a Comment for "Chrome Devtools - Inconsistent Array Length"