+ 3

For what is setInterval, I do not understand where and how to use it

4th Jul 2017, 11:15 PM
Javier I. Rivera R.
Javier I. Rivera R. - avatar
3 Answers
+ 3
x = setInterval(() => {console.log("hi")}, 500) the code above will logs hi every 500ms
5th Jul 2017, 12:08 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 3
Take a look at this example I did so you can have a better understanding: https://code.sololearn.com/WtWo50WAHrTt/#js
10th Aug 2017, 10:43 PM
Juan F R G
Juan F R G - avatar
+ 1
Generally when creating an animation on your webpage. it work just like thread in Java.
4th Jul 2017, 11:49 PM
Nura Programmer
Nura Programmer - avatar