10 lines
225 B
JavaScript
10 lines
225 B
JavaScript
function getHighscore(game) {
|
|
return parseInt(localStorage.getItem('hs_' + game) || '0', 10);
|
|
}
|
|
|
|
function setHighscore(game, score) {
|
|
if (score > getHighscore(game)) {
|
|
localStorage.setItem('hs_' + game, score);
|
|
}
|
|
}
|