Last active
November 5, 2020 18:44
-
-
Save ilyahuman/97dade213cf77cff5120d75047c2cf7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let timerId = setTimeout(function tick() { | |
timerId = setTimeout(tick, 2000) // here you can pass any timeout and dynamically change next calls | |
}, 1000); | |
// Example | |
let call = 1; | |
let timerId = setTimeout(function tick() { | |
timerId = setTimeout(tick, 2000 * call); | |
call++; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment