有人能告诉我如何存储10个分数并使用本地存储在一行中显示一个分数吗?
var score = new Array(10);
var highscore = new Array();
var len = score.length;
function f_score() {
for (i = 0; i < len; i++) {
for (j = 0; j < len; j++) {
if (score[j] < score[j + 1]) {
temp = score[i];
score[i] = score[i + 1];
score[i + 1] = temp;
}
localstorage.setItem("highscore", score);
var highscore = localstorage.getitem("highscore");
}
}
document.write(highscore + "<br>")