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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -