DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
8+8 =
Submit