Archive: March de 2017

Object.assign performance on using with collections.

With ES2016 we have many things write shorter and look better. Small experiment of using Object.assign. I have tried to use it in reduce functions that’s convert collection to index object. For example to index by id with and without Object.assign: collection.reduce((items, item) => { items[] = item; return items; }, {}); collection.reduce((items, item) => […]