Turn objects into array
Turn objects into array
I have created 3 instances of my box object, but would like to access these as if they were a numbered index array. Is this possible?
- function box(position, text) {
this.pos = position;
this.tex = text;
}
////////////////////////////////////////////////
var box1 = new box(1, "text 1");
var box2 = new box(2, "text 2");
var box3 = new box(3, "text 3");