我正在尝试为对象属性分配一个值,但它没有被存储。
for (var i = 0; i < players.length; i++) {
if (players[i].volume < 1) players[i].volume = (Math.round((players[i].volume + 0.1) * 10) / 10); // JS math error fix
settings[players[i].id] = settings[players[i].id] || players[i].id;
settings[players[i].id].volume = players[i].volume;
console.log(settings[players[i].id] + " " + players[i].id + " " + players[i].volume + " " + settings[players[i].id].volume);
}
settings[players[i].id].volume
==undefined
小提琴
如何存储音量?