JavaScript setTimeout and setInterval: Difference between setTimeout and setInterval Methods

Publicado el: 04 noviembre 2014
en el canal de: Crypters Infotech
3,337
22

https://www.udemy.com/practical-javas...

JavaScript setTimeout and setInterval: Difference between setTimeout and setInterval Methods

Both setTimeout and setInterval methods are timer methods with the same syntax. The setTimeout method is used to execute a function after a specific delay and the setInterval method is used to execute a function repeatedly at specified intervals.

In this video, we update a slider using setInterval and setTimeout methods. You could find that the setInterval method updates the slider at specified intervals whereas the setTimeout method updates the position of the slider just once after the specified delay.

Once the timer is of no use, then you should clear the timer using clearInterval method in case of setInterval method and using clearTimeout method in case of clearTimeout method.

To see how to use the setInterval method to create a clock, see this video:
   • JavaScript: Create a Clock using JavaScrip...  


En esta página del sitio puede ver el video en línea JavaScript setTimeout and setInterval: Difference between setTimeout and setInterval Methods de Duración hora minuto segunda en buena calidad , que subió el usuario Crypters Infotech 04 noviembre 2014, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,337 veces y le gustó 22 a los espectadores. Disfruta viendo!