Array.reduce to populate an object

An easy way to populate an object from a collection is to use reduce: var collection = [{id: 1, value: 'foo'}, {id: 2, value: 'bar'}]; var result »