How can I display all properties of a JavaScript array/object in Chrome?


Staff member
JavaScript has a <a href="" rel="nofollow noreferrer">surprisingly confusing distinction</a> between arrays and objects and <a href="" rel="nofollow noreferrer">array-like objects</a>:

var a = [];  // empty array, right? = 'bar';  // a is also an object

The problem is that when inspecting variables in the Chrome DevTools console, it will appear that
is only an empty array:

<img src=" " alt="Chrome is confused by objects/arrays">

This sort of array/object usage happens with <a href="" rel="nofollow noreferrer">3rd party code</a>, so I'm looking for a way to <strong>show all properties of a variable in Chrome DevTools</strong>.