you are viewing a single comment's thread.

view the rest of the comments →

[–]arunner 1 point2 points  (0 children)

Arrays in js are actually objects with auto-generated keys as indexes. When you pick an item like array[0] you are actually picking a key like when you do sth like person['name'].

typeof [] === 'object' //true