Array.prototype.toObjectByProperty( element=> )

T.J. Crowder tj.crowder at
Wed Aug 9 08:34:11 UTC 2017

On Wed, Aug 9, 2017 at 9:24 AM, Jordan Harband <ljharb at> wrote:
> I think you're misunderstanding; the function would of course take
> an iterable. However, an iterable of what?
> If it's an iterable of objects, then what's the key and what's the
> value? What if it's an iterable of strings?

I can't speak for Naveen, he's gone off in his own direction (or rather, I
have, as it was originally his thread).

But for my part, as I [describe here][1], the common case *I* want to
address is that the value *is* the entry. No round-trip through `[key,
value]` pairs is required for the common use case of creating a map/object
to provide lookup by key. I certainly see why Darien may *also* want to
provide somthing for `[key, value]` pairs, but I see it as separate.

-- T.J. Crowder

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list