add getter

This commit is contained in:
Florian Schmid 2023-04-19 20:03:14 +02:00
parent 5f61cf50be
commit 026f58b3cc

View File

@ -1,4 +1,4 @@
class Stats { export class Stats {
#score; #score;
#highScore; #highScore;
#highScoreStorageKey; #highScoreStorageKey;
@ -20,4 +20,12 @@ class Stats {
localStorage.setItem(this.#highScoreStorageKey, this.#highScore); localStorage.setItem(this.#highScoreStorageKey, this.#highScore);
} }
} }
get highScore() {
return this.#highScore;
}
get score() {
return this.#score;
}
} }