David Bruant (2013-12-26T00:33:27.000Z)
Hi,

I was reading the current spec for Array.from and it felt too 
complicated to me. Currently, at a high-level it reads like:
1) if the argument is iterable (@@iterable symbol), create a fresh array 
made of the values iterated on with the iterator
2) (step9) if the object is array-like, len = [[Get]] ('length') and 
from 0 to len-1, copy the values of the array-like in a fresh array to 
be returned.

Note that between the two parts, a good share of spec is duplicated.

For the rationale, the wiki states [1]:
"There are many array-like objects in JS (arguments objects, DOM 
NodeLists, arrays from separate windows, typed arrays) and no simple way 
to convert one of these to an instance of Array in the current window; 
this is the rationale behind a simple conversion function (Array.from)."

I think that if all of these objects had a good default @@iterable, 
there wouldn't be a need for the array-like part of Array.from.
The "good default" most likely being based on .length, etc.

David

[1] http://wiki.ecmascript.org/doku.php?id=strawman:array_extras
domenic at domenicdenicola.com (2014-01-06T14:19:09.619Z)
I was reading the current spec for Array.from and it felt too 
complicated to me. Currently, at a high-level it reads like:

1. if the argument is iterable (`@@iterable` symbol), create a fresh array made of the values iterated on with the iterator
2. (step9) if the object is array-like, `len = [[Get]] ('length')` and from `0` to `len-1`, copy the values of the array-like in a fresh array to  be returned.

Note that between the two parts, a good share of spec is duplicated.

For the rationale, the wiki at http://wiki.ecmascript.org/doku.php?id=strawman:array_extras states:

> There are many array-like objects in JS (arguments objects, DOM NodeLists, arrays from separate windows, typed arrays) and no simple way to convert one of these to an instance of Array in the current window; this is the rationale behind a simple conversion function (Array.from).

I think that if all of these objects had a good default `@@iterable`, 
there wouldn't be a need for the array-like part of `Array.from`.
The "good default" most likely being based on `.length`, etc.