javascript - Can anyone tell me how to store 10 scores and display one score in a line using local storage? -
can tell me how store 10 scores , display 1 score in line using local storage?
var score = new array(10); var highscore = new array(); var len = score.length; function f_score() { (i = 0; < len; i++) { (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>")
Comments
Post a Comment