> Arrays are exotic objects that give special treatment to a certain class of property names. See 10.4.2 for a definition of this special treatment.
I just meant these special properties. The behavior, apart from the square-bracket syntax for construction, can be emulated using Object property descriptors, Symbol.iterator etc, but AFAIK, much of this is retro-fitted.
Not disagreeing with the fact that arrays are almost just regular objects in JS, but the "just" in "just objects" does have nuances, AFAIK.
JIT Optimizations for non-sparse arrays might just be part of a larger hot-path optimization system, but I think there are still differences.
Is it possible to create an object for which
Array.isArray
returns true without it being instantiated using an array constructor or other array-returning function, the Array prototype, or square-bracket syntax?
> Arrays are exotic objects that give special treatment to a certain class of property names. See 10.4.2 for a definition of this special treatment.
I just meant these special properties. The behavior, apart from the square-bracket syntax for construction, can be emulated using Object property descriptors, Symbol.iterator etc, but AFAIK, much of this is retro-fitted.
Not disagreeing with the fact that arrays are almost just regular objects in JS, but the "just" in "just objects" does have nuances, AFAIK.
JIT Optimizations for non-sparse arrays might just be part of a larger hot-path optimization system, but I think there are still differences.
Is it possible to create an object for which
returns true without it being instantiated using an array constructor or other array-returning function, the Array prototype, or square-bracket syntax?E.g.
...all implicitly use the built-in Array prototype.
I'm not sure if it's possible to build an array using only primitives and functions from the
namespace, for example.