News for hackers. Stuff that matters.
Re:How to use array reduce for more than just numbers by edgarvm on Sunday June 02, 2019 @06:26PM (#20078738)
You don't need a function, this is my little trick to convert an array to object

peopleObj = peopleArr.reduce( (a,x) => (a[x.username]=x, a), {} );

There are no comments on this comment yet.