Reset values in timer

Hi everyone.

I have got a problem with my timer. I am almost at the end of my task, but one thing is not working properly - after clicking RESET button clock stopped, but the values are not going back to zero.

My code is below:


Not sure what this app is supposed to do when you click on PLAY or RESET. Neither seem to do anything. Maybe you should walk us through how you are supposed to use to see the issue you are having.

If you need all my JS code (300 lines), but OK maybe more info.
I miss clear option in this timer in the game.

Actually, I am not even sure why you have ${1 % 1} here

Because inside the timer (00:00:00) I need number not string. ‘0’ give string, expression 1%1 is always number. Maybe I am wrong.

The one more problem is when I put console.log - when time range is 10-59, I take “010”, “011” etc., not “10”, “11”…

OK, but how to put every timer values to zero after click RESET button (which only stop time, without resetting it)? Make new function/value?

This will be a clock for the game. Time is going up from 00:00:00 by 1 second and timer could be clear in any moment by a user (click RESET button).

At this moment my timer can be only stopped - I need stop and clean all value to 00:00:00.

For example: 00:00:00 (click start) -> 00:02:13 (click reset = stop + clean by some function or value) -> 00:00:00

I know that clicking RESET button don’t reset the timer (as it should), but there could be more than one event “connected” into mouse click, right?

Probably you need all my code (with text explaining game rules):