Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js array to object

const result = arr.reduce((obj, cur) => ({...obj, [cur.sid]: cur}), {})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #array #object
ADD COMMENT
Topic
Name
5+4 =