jquery - Merge two multidimentional objects in javascript -
---- object 1 ----
var sib1 = { fname: 'sangram', lname: 'jadha', image: 'male.jpg', id: '1', }
---- object 2 ----
var sib2 = { fname: 'sam', lname: 'jad', image: 'male.jpg', id: '2', }
----- expected output --------
var sib3 = { { fname: 'sangram', lname: 'jadha', image: 'male.jpg', id: '1', }, { fname: 'sam', lname: 'jad', image: 'male.jpg', id: '2', } }
you can push objects 1 after other sib3
sib3 = new array(); sib3.push(sib1); sib3.push(sib2);
this has work if looking array of objects derived different individual objects.
Comments
Post a Comment