Reputation: 41
I know this is probably really difficult, because I want something like Object1, Object2, etc. This is what I think might work, but probably won't.
for(var x = 1; x<=10; x++){
var Object + x = new Object();
};
What should I do instead. Thanks in advance!
Upvotes: 1
Views: 56
Reputation: 2783
var objects = {};
for (var x = 0; x < 100; x++) {
objects[x] = {name: "value"}; //value can be a string like "value" or a var like value
}
Upvotes: 2