Skip to content

Instantly share code, notes, and snippets.

@devarajchidambaram
Created July 5, 2018 09:46
Show Gist options
  • Save devarajchidambaram/3876f9b2c8ea9d7a3eec564b89828de7 to your computer and use it in GitHub Desktop.
Save devarajchidambaram/3876f9b2c8ea9d7a3eec564b89828de7 to your computer and use it in GitHub Desktop.
Pass argument setTimeout callback (fn, time, arg)
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