-
-
Save wvxavier/d01d3303b4a72c7b651966f9a8c39cf4 to your computer and use it in GitHub Desktop.
2-callback-old-sintax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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