Hi when I assign the simple setTimeOut() function to a variable and console the variable, it produces some integer value as below:
So, I want clarification on what the value denotes. The value is changing when I try the same again. So please provide me an explanation of the value we get while assigning the setTimeOut() to a variable.
The setTimeout
function returns a unique id with which you can stop your setTimeout
like this clearTimeout(timeoutID)
. It's the same with setInterval
.
See here.
Greetings, Flo
The function setTimeout() returns an identifier that you can use to prevent the execution of the function by calling clearTimeout()
It is id returned from setTimeout() which used to clear the timeout
myTimeout = setTimeout(function, milliseconds);
clearTimeout(myTimeout);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.