Created
July 5, 2018 09:46
-
-
Save devarajchidambaram/3876f9b2c8ea9d7a3eec564b89828de7 to your computer and use it in GitHub Desktop.
Pass argument setTimeout callback (fn, time, arg)
This file contains hidden or 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
function myFunc(arg) { | |
console.log(`arg was => ${arg}`); | |
} | |
//In nodejs we can pass the arguments.. | |
// nodejs, actually provides its own implementation of these timer methods | |
setTimeout(myFunc, 1500, 'funky'); | |
//> clear | |
//clearImmediate clearInterval clearTimeout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment