C. Scott Ananian (2014-02-25T03:22:27.000Z)
On Mon, Feb 24, 2014 at 4:24 PM, Claude Pache <claude.pache at gmail.com> wrote:
> Indeed, but the question was about producing/forwarding holes rather than skip them, so that, e.g., `Array.from` could replace the elements at the correct positions.

You'd probably want `Array.fromEntries` then, and pass in an
appropriate entries iterator.  Note that `Map()` already takes an
entries iterator; maybe you'd want an `Object.fromEntries` as well?

The more this is discussed, the more I am convinced that the current
"holes are evil" behavior of `Array.from` and the `ArrayIterator` is
the correct thing.  Once you start introducing holes, they crop up
everywhere.  Just mentally tell yourself that `Array.from` is a method
to fill in holes, *not* a method to clone an array.  Use one of the
discussed workarounds if you need holes.
  --scott
domenic at domenicdenicola.com (2014-03-02T22:44:55.994Z)
You'd probably want `Array.fromEntries` then, and pass in an
appropriate entries iterator.  Note that `Map()` already takes an
entries iterator; maybe you'd want an `Object.fromEntries` as well?

The more this is discussed, the more I am convinced that the current
"holes are evil" behavior of `Array.from` and the `ArrayIterator` is
the correct thing.  Once you start introducing holes, they crop up
everywhere.  Just mentally tell yourself that `Array.from` is a method
to fill in holes, *not* a method to clone an array.  Use one of the
discussed workarounds if you need holes.