Last active
August 29, 2015 14:15
-
-
Save DronRathore/b39b118ce828d3f23938 to your computer and use it in GitHub Desktop.
setTimeout = setInterval
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
/* | |
Law: clearInterval = clearTimeout | |
*/ | |
var a = setTimeout(function(){console.log(1)}, 100); | |
clearInterval(a); | |
var b = setInterval(function(){console.log(1)}, 100); | |
clearTimeout(b); | |
/* | |
Nothing will be logged on console! | |
We cleared the timers! | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment