Rick Waldron (2013-12-26T04:00:29.000Z)
domenic at domenicdenicola.com (2014-01-06T14:20:07.086Z)
On Wed, Dec 25, 2013 at 7:33 PM, David Bruant <bruant.d at gmail.com> wrote: > I was reading the current spec for `Array.from` and it felt too complicated > to me. I've been following the specification of `Array.from` very closely since the day Dave and I first designed it and it's exactly as complicated as it needs to be for what it needs to be able to do. > 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. The array-like part is for all of those objects that _won't_ have an `@@iterator`, for one reason or another, and for useful shimming in ES5 runtimes. `Array.from` can be implemented today for array-likes without Symbols + `@@iterator` and the same code using `Array.from` will work correctly with the built-in `Array.from` once those `if (typeof Array.from === "undefined") {...` check evaluate to `false`.