0
反正是有去形成這個二維對象/關聯數組成三維對象中的JavaScript
var stateDat = {
ME: ['Maine',1328361],
etc.
};
對此
var stateDatHistory = {
1:[
ME: ['Maine',1328361],
etc.
],
2:[
ME: ['Maine',1328361],
etc.
],
etc
};
動態的功能?例如,這不起作用...
turn = 1;
function start(){
stateDatHistory[turn].push(stateDat);
stateDat['ME'][1]= stateDat['ME'][1] - 500; //changing population
turn++;
}
數組文字不能有'ME:'裏面 –