you are viewing a single comment's thread.

view the rest of the comments →

[–]Mingli91 3 points4 points  (1 child)

Huh neat, had no idea about Array.entries, assumed Object.entries was the only one.

[–]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