3 ms·
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), {} );
by edgarvm 7y ago
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), {} );