Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Convert Array to Array Object Javascript

// from [1,2,3]
// to [{id:1},{id:2},{id:3}]

let data = ids.map((id)=>  ({id:id}))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Convert #Array #Array #Object #Javascript
ADD COMMENT
Topic
Name
6+1 =