How | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How

How to write a script in JS that works automatically with time; Example; clicks=0 // each second clicks += 1

24th Aug 2018, 8:00 PM
Sousou
Sousou - avatar
5 Answers
+ 1
To repeat a function after a certain amout of time you need to use the setInterval() function. e.g. setInterval( function(){ //your Code here }, 1000);
24th Aug 2018, 9:00 PM
BraveHornet
BraveHornet - avatar
+ 1
Please help
24th Aug 2018, 8:04 PM
Sousou
Sousou - avatar
+ 1
what is "1000"
24th Aug 2018, 9:01 PM
Sousou
Sousou - avatar
+ 1
1000 Millisecounds
24th Aug 2018, 9:03 PM
BraveHornet
BraveHornet - avatar
+ 1
Oh ok, Thanks for help
24th Aug 2018, 9:04 PM
Sousou
Sousou - avatar