Hi, I’m trying to get a ‘start’ button functioning on my code. I managed to get the ’ stop reset ’ button functioning through calling clearInterval(), but now I’m stuck trying to figure out to start this little game back up. Can you restart a setInterval() after it has already been cleared? I’m still new to this, but here was my thought process:
- Take setInterval() and store in variable ‘game’.
- Select ‘start’ button store in variable ‘startG’.
- Create function startGame() set what I want to happen, and call ‘game()’ inside the function.
- Add event listener to ‘startG’ listen for click and call ‘startGame()’.
If anyone can help me out here it would be greatly appreciated.