Here is what I did in my games:
- On start layout-> LocalStorage check "bestScore" exist.
- If item exist-> set bestScore to LocalStorage.ItemValue (no need to get it)
- If missing-> set bestScore to 0
You only need to check the gameScore>bestScore is enough.
Then set bestScore to gameScore.
And set key to gameScore.