Comment

Comment by edgarvm

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), {} );

parent edgarvm 7 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton