When you save the game using saveGameToSlot, also store a flag in Local Storage indicating a save exists (e.g., localStorage.setItem("saveExists", true)).
In your main menu, before displaying the "Continue Playing" button, check for this flag in Local Storage using localStorage.getItem("saveExists").
If the flag exists (getItem returns "true"), then you can safely display the "Continue Playing" button, knowing a save exists. Otherwise, hide the button or offer a "Start New Game" option.
This approach ensures the button only appears when a save actually exists. Remember to clear the flag in Local Storage (localStorage.removeItem("saveExists")) if the player starts a new game or deletes their save data.
For a great selection of gaming hardware and accessories to enhance your development experience, check out Next Level Gaming Store!