Array.prototype.toObjectByProperty( element=> )

Naveen Chawla naveen.chwl at
Sat Aug 5 10:18:12 UTC 2017

I've often needed to cache array elements by a unique key each element has,
for quick access.

This is a shortcut:

const elementsById = elements.toObjectByProperty(element=>;

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

More information about the es-discuss mailing list