apend js object code example
Example 1: object javascript append
var list = [];
list.push({name:'John', last_name:'Doe'});
list.push({name:'Jane', last_name:'Doe'});
console.log(list);
/* Result:
[
{
"name": "John",
"last_name": "Doe"
},
{
"name": "Jane",
"last_name": "Doe"
}
]
*/
Example 2: javascript append to object
alerts.push({num : 3, app:'helloagain_again',message:'yet another message'});