Skip to content

Instantly share code, notes, and snippets.

@wvxavier
Last active August 24, 2020 07:57
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 wvxavier/d01d3303b4a72c7b651966f9a8c39cf4 to your computer and use it in GitHub Desktop.
Save wvxavier/d01d3303b4a72c7b651966f9a8c39cf4 to your computer and use it in GitHub Desktop.
2-callback-old-sintax
function myFunction(myCallback) {
setTimeout(function anotherFunction() {
myCallback("error", undefined);
}, 2000);
}
myFunction(function oneMoreFunction(error, result) {
if (error) {
return console.log(error);
}
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment