I define an object as follows (one line of input, one line
of output from the firefox console):
a = { length: 3 }
Object { length: 3 }
Now I observe the following three evaluations:
a[ 0 ]
undefined
a[ 1 ]
undefined
a[ 2 ]
undefined
. So, is »a« now an »array-like object«, because it has
a lenght between 0 and 9007199254740991 and it has three
entries for the numeric keys 0 <= key < lenght, which
just so happen to be »undefined«?
b = Array.from( a )
Array [ undefined, undefined, undefined ]
So, the only thing we require for an object to be »array-like«
is a length property with an appropriate value?
(The relevant section of ECMAScript seems to be
7.3.17 CreateListFromArrayLike (obj [, elementTypes] ).
I am asking here just to be sure. For example, I am not
sure whether an undefined value triggers an »ReturnIfAbrupt«,
but it does not seem to be so.)