i'm new to object oriented javascript so while i was practicing i created this code here :
ap = []; //creating an empty array to hold persons;
pp = function (f, l, a, n, g) { //this is our object constructor
this.fname = f;
this.lname = l;
this.dob = a;
this.nat = n;
this.gen = g;
};
ap[ap.length] = new pp(f, l, a, n, g); // adding the newely created person to our array through the constructor function . btw parameters passed to the function are defined in another function ( details in the jsfiddle file)
the purpose from this code is to get used to objects creation and manipulation . so i waswondering if there is any easier way and more logical method to fulfill the same task .
well anyhelp would be appreciated and thanks.