Skip to content

Instantly share code, notes, and snippets.

@wvxavier

wvxavier/2-callback-old-sintax.js Secret

Last active Aug 24, 2020
Embed
What would you like to do?
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