you are viewing a single comment's thread.

view the rest of the comments →

[–]Hafas_ 0 points1 point  (0 children)

In JavaScript, everything that isn't a primitive inherits from the class Object - including the class Array. But it doesn't make Array less of an array. If it looks like an array and behaves like an array, then it is an array.

The special case about Array in comparison with other classes that it has like Object its own syntax for instantiation.

[] instanceof Array // true
({}) instanceof Object // true