Below I have a page design, where I have two input boxes.
Name and age.
I also have an add button.
Upon clicking the add button I have span elements with name and age

and above will be grouped, say "friends"
like wise another group, contains a list of person objects
now i have to store data like
group 1-
list of objects
name - age
name - age
group 2 -
list of objects
name - age
name - age.
later will submit the data.
I have tried var person = new Object(); , but I am looking to have key value like
name: firsname , age: 23
or is there any alternative way to achieve this..thanks in advance.
EDIT- i need to do this dynamically upon click add button
var person = {name: firstname, age: 23};thenarrayofpersons.push(person)???