let obj = { name: 'Bob' };
let arr = [{ name: 'John' }];
// add obj to array
arr = [...arr, obj];
console.log(arr) // [{ name: 'Bob' }, { name: 'John' }];
var object = {name: 'Bhavansh'};
var array = [ ]; // Create empty array
// Add object to the array
array.push(object);
// To access the object
console.log(array[0].name);
var nietos = [];
var obj = {};
obj["01"] = nieto.label;
obj["02"] = nieto.value;
nietos.push(obj);
var nietos = [];
var obj = {};
obj["01"] = nieto.label;
obj["02"] = nieto.value;
nietos.push(obj);
var object = "Some Object"
var array = []
array.push(object)