Skip to content

Instantly share code, notes, and snippets.

@firoze
Created November 29, 2017 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firoze/c4bd2c3c471b0b3f68406eb5991d40df to your computer and use it in GitHub Desktop.
Save firoze/c4bd2c3c471b0b3f68406eb5991d40df to your computer and use it in GitHub Desktop.
Delayer Promise
function delay(t){
return new Promise(function(resolve){
return setTimeout(resolve, t);
});
}
function logHi(){
console.log('hi');
}
delay(2000).then(logHi);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment