number setInterval(function callback, number delay, any rest)

Set a timer. Execute the registered callback function according to a set period (in milliseconds)

Parameter

function callback

Callback function

number delay

The time intervals (in milliseconds) between executed callback functions.

any rest

Additional parameters such as param1, param2, ..., paramN, which are passed to the callback function as parameters.

Return

number

Timer number. This value can be passed to clearInterval to cancel the timer.