Google Chrome console isn't displaying array-like objects correctly when their indexers are get/set based? Google Chrome console isn't displaying array-like objects correctly when their indexers are get/set based? google-chrome google-chrome

Google Chrome console isn't displaying array-like objects correctly when their indexers are get/set based?


While this doesn't answer the question of WHY Chrome won't write out your array like an array, there is a way to "trick" Chrome into doing it. Luckily for us, it's super simple.

  1. Overwrite the toString function of your object, returning your data variable
  2. When you log your array, log it as myArray.toString();

See this jsFiddle: http://jsfiddle.net/YXwxS/

In the meantime, I'm going to keep researching this because it's an interesting problem :)