Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nafeu/5c4838adfd64b11e4666aa03f2541487 to your computer and use it in GitHub Desktop.
Save nafeu/5c4838adfd64b11e4666aa03f2541487 to your computer and use it in GitHub Desktop.
console.log('1 | print immediately');
delay(() => '2 | print me after one second', 1000)
.then(result => {
console.log(result);
delay(() => '3 | print me one second after line 2', 1000)
.then(result => {
console.log(result);
/* ...CALLBACK HELL... */
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment