+ 1

timer function inside function

its a timer. pretty self explanatory. its inside a function which the timer itself is a function and every time you click the New Game button it goes down 1 but i want it so when you click the new game button its goes down all the way to 0 wothout clicking 10 times. https://code.sololearn.com/WmDqB7JwVfKT/?ref=app

11th Aug 2022, 1:15 AM
Junior
Junior - avatar
10 odpowiedzi
+ 1
It's the timer. pretty self-explanatory. You should look closely at line 70 since it is the heart of your timerf function.
11th Aug 2022, 11:24 AM
ODLNT
ODLNT - avatar
+ 1
interval = setTimeout(timerf, 1000); // at line 70
12th Aug 2022, 1:37 PM
SoloProg
SoloProg - avatar
0
i dont see anything at line 70 ODLNT
12th Aug 2022, 1:04 PM
Junior
Junior - avatar
0
on conputer, why does my alert pop up first then my timer goes to 0 but on mobile it doesnt do that?
12th Aug 2022, 9:31 PM
Junior
Junior - avatar
0
also how can i fix that
12th Aug 2022, 9:31 PM
Junior
Junior - avatar
0
Your Mom I suggest you finish the CSS and Javascript courses it will benefit you a lot and your programs will be much better.
13th Aug 2022, 2:32 PM
SoloProg
SoloProg - avatar
0
SoloProg you know the answer or not? need me to explain better? or is the answer in the lessons
13th Aug 2022, 2:35 PM
Junior
Junior - avatar
0
mmm no very sry Oo"
13th Aug 2022, 2:37 PM
SoloProg
SoloProg - avatar
0
SoloProg its alr. i should probably finish the course
13th Aug 2022, 2:38 PM
Junior
Junior - avatar
0
Your Mom window.onload = () => { // Execute a JavaScript immediately after a page has been loaded }
13th Aug 2022, 2:48 PM
SoloProg
SoloProg - avatar