I have several arrays with stored information from a simple form
var name = [a, b, c, ...];
var last = [x, y, z, ...];
var age = [1, 2, 3];
Now it is the idea that when someone new fills in the form, and thus a new element is added to the arrays, a new object is created which holds this persons information like:
function Person(name,last,age){
this.name=name;
this.last=last;
this.age=age;
}
var object1 = new Person(name[1],last[1],age[1]);
Obviously I don't want to manually create a new object every time, so I guess something has to be done with a for loop, but how does this generate a new name for object(i)?
I am quite new to javascript, and possibly I am overthinking things and is the answer staring me right in the face, But I really could use some help here. Thanks a million!