說,我想是這樣的:使用其他變量作爲計數器創建JavaScript變量
var i = 0;
for (i upto 100) {
var x+i = "This is another variable altogether";
i++;
}
JavaScript解釋器會看到:
var x = "This is another variable altogether";
var x1 = "This is another variable altogether";
var x2= "This is another variable altogether";
var x3 = "This is another variable altogether";
var x4 = "This is another variable altogether";
我可以用一個變量計數器遞增名稱的變量,所以我有完全不同的變量?
爲什麼不使用關聯數組呢? – DCoder