dimanche 13 novembre 2016

Loop object which has property value of n in JS

THIS IS THE MEMBER OBJECT

fuction member() {
       this.name = name;
       this.isTaken = false;
    }

THIS IS THE ARRAY OBJECT

function group() {
   this.members = [new member(blahhh)];
}

Now, I want to create a prototype of the group object that will iterate and generate a random number based on the index which has a value of true in isTaken property inside the array. If one object has been chosen, its isTaken property will be change to true.




Aucun commentaire:

Enregistrer un commentaire