Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript join object properties in array

const data = [{id: 111}, {id: 22222, a:222}, {id:333,a:3}];

console.log(Object.keys(data).map(key => `${key}: ${data[key].id}`).join(","));
// 0: 111, 1: 22222, 2: 333
 
PREVIOUS NEXT
Tagged: #javascript #join #object #properties #array
ADD COMMENT
Topic
Name
6+2 =