I have two objects of person:
var p1 = {firstName:"John", lastName:"Doe", age:46};
var p2 = {firstName:"Joanne", lastName:"Doe", age:43};
How can i add these objects to a persons array and access it by index?
All i know is to initialized the persons:
var persons = [
{firstName:"John", lastName:"Doe", age:46},
{firstName:"Joanne", lastName:"Doe", age:43}
];
var persons = [p1, p2]