I have 2 json object. i need to push inside array like this. Later i need to store the complete object in localstorage
function(cObj,bObj) { }
First array i should get.
object
localArray: Array[2]
cObj
....
bObj
Again when the function is called, i should get
object
localArray: Array[2]
cObj
....
bObj
localArray: Array[2]
cObj
....
bObj
This is what i am doing.
localObj = {}
localObj.localArray = [];
localObj.localArray.push(cObj,bObj);
localStorage.localObj = JSON.stringify(localObj);
How to store the complete object in localstorage?
localArray