Skip to content

Instantly share code, notes, and snippets.

@dd701116
Last active March 29, 2021 05:32
Show Gist options
  • Save dd701116/bdc68c8fbd793f3b95f6fbdf3c4f276b to your computer and use it in GitHub Desktop.
Save dd701116/bdc68c8fbd793f3b95f6fbdf3c4f276b to your computer and use it in GitHub Desktop.
The 3 ways to make an asynchronous method in JavaScript
// The callback method
function theCallback() {
console.log("Hello from the callback !");
}
// The callback will execute in 1000 ms
setTimeout(theCallback,1000);
console.log("Hello World !");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment