Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
186
rated 0 times [  193] [ 7]  / answers: 1 / hits: 134979  / 15 Years ago, thu, march 4, 2010, 12:00:00

Basically I want to create one large object of many object in JavaScript. Something like:



var objects = {}
for (x)
objects.x = {name: etc}


Any ideas?


More From » loops

 Answers
34
var objects = {};

for (var x = 0; x < 100; x++) {
objects[x] = {name: etc};
}

[#97425] Tuesday, March 2, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
briza

Total Points: 259
Total Questions: 94
Total Answers: 101

Location: Reunion
Member since Mon, Dec 28, 2020
3 Years ago
;