Array.prototype.toObjectByProperty( element=>element.property )

Naveen Chawla naveen.chwl at gmail.com
Tue Aug 8 09:01:12 UTC 2017


Yeah except in what I'm saying it's optional

On Tue, 8 Aug 2017 at 14:16 T.J. Crowder <tj.crowder at farsightsoftware.com>
wrote:

> On Tue, Aug 8, 2017 at 9:39 AM, Naveen Chawla <naveen.chwl at gmail.com>
> wrote:
> > I'd like to propose an enhancement to my proposal:
> > ...
> > It offers the same functionality, but in addition a second
> > optional parameter for the "value" in case you want something
> > other than the array element as the value. By default, if the
> > second parameter isn't populated, it should use the array
> > element itself, like the example call redundantly passes.
>
> This is part of why Darien's proposal and my suggestion from [my first
> reply in this thread][1] are complementary: That's exactly what you get
> with Darien's, by returning `[key, value]`. Conflating them makes each of
> them unnecessarily complicated in my view.
>
> -- T.J. Crowder
>
> [1]:
> https://esdiscuss.org/topic/array-prototype-toobjectbyproperty-element-element-property#content-2
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170808/dbcd5671/attachment.html>


More information about the es-discuss mailing list