Timer Methods in Javascript | setTimeout() | setInterval() & clearInterval() | INIT Tech Labs

Published: 23 May 2024
on channel: INIT Tech Labs
53
6

Javascript's window object offers 2 timer based methods - setTimeout() & setInterval().

setTimeout() is used to execute code after a specific time. You can configure a timeout for the code execution.
Syntax : setTimeout( function, time in milliseconds)

setInterval() is used to execute code on regular intervals of time. The code will keep executing after a time interval.
Syntax : setInterval( function, time in milliseconds)

clearInterval() is used to clear/stop the setInterval(). To stop an interval, pass the instance of the setInterval() as an argument.
Syntax : clearInterval( instance of setInterval() )

.
.
.
#inittechlabs #programming #codewithdj #nirmaljoshi #javascript #knowledgesharing


On this page of the site you can watch the video online Timer Methods in Javascript | setTimeout() | setInterval() & clearInterval() | INIT Tech Labs with a duration of hours minute second in good quality, which was uploaded by the user INIT Tech Labs 23 May 2024, share the link with friends and acquaintances, this video has already been watched 53 times on youtube and it was liked by 6 viewers. Enjoy your viewing!