Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reduce an array of objects into a single object

var object = arr.reduce((obj, item) => (obj[item.key] = item.value, obj) ,{});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reduce #array #objects #single #object
ADD COMMENT
Topic
Name
8+8 =