Answers for "merge array of objects javascript"

3

javascript object array merge

var arr1 = [{name: "lang", value: "English"},{name: "age", value: "18"}];
var arr2 = [{name : "childs", value: '5'}, {name: "lang", value: "German"}];

Array.prototype.push.apply(arr1,arr2); 

console.log(arr1);  // final merged result will be in arr1
Posted by: Guest on June-01-2020
43

merge two objects javascript

const object1 = {
  name: 'Flavio'
}

const object2 = {
  age: 35
}
const object3 = {...object1, ...object2 } //{name: "Flavio", age: 35}
Posted by: Guest on July-13-2020
0

merge array of objects javascript

Object.keys(arrayObject).map(key=>arrayObject[key]).reduce((old,item)=>(
          {...old,...item}
),{})
Posted by: Guest on July-22-2021
0

javascript object array merge

var arr1 = new Array({name: "lang", value: "English"}, {name: "age", value: "18"});
var arr2 = new Array({name : "childs", value: '5'}, {name: "lang", value: "German"});
Posted by: Guest on June-02-2020

Code answers related to "merge array of objects javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language