JavaScript LocalStorage Get Number, não string

if (localStorage.getItem("score") !== null) {
    score = Number(localStorage.getItem("score"));
}
Eager Earthworm