I want to add a high score to my game. Right now I have this:
var score = 0; var highscore = 0;
The score variable works but whenever I get
if (score > parseInt(localStorage.getItem('highscore'), 10)) { localStorage.setItem('highscore', score); }
convert into int before comparing. its string