+ 1
Does "setinterval" make the event occur periodically?
3 Answers
+ 1
I think it does. in other languages a while loop is used for this behavior. but it looks like in JavaScript the behavior continues until it's cleared.
+ 1
yes it does. whatever value you pass as the second argument will be your period (in milliseconds)
+ 1
Take a look at this example I did so you can have a better understanding of setInterval:
https://code.sololearn.com/WtWo50WAHrTt/#js