Create an Object within Array.

  1. 9 months ago

    I want to create an array for each member in our football team - so to start with if it was in JQM it would start with -

    players = new Aarray(11);

    Then from here I wish to create an object for each Player where I can add there age, position, goals etc again in JQM I would use something like this:

    players[0] = new Object();
    players[0].age = 21;
    players[0].position = "GK";
    players[0].goals = 0;

    But I can't fathom how to do it - Can anyone help a new convert?

or Sign Up to reply!