Last active
December 14, 2015 14:58
-
-
Save dvideby0/5104045 to your computer and use it in GitHub Desktop.
Simple example explaining how to work with callbacks..
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 myasyncfunc(param1, param2, callback) { | |
var p4 = param1 + param2; | |
callback(p4); | |
} | |
function DoSomethingSynchronous(){ | |
myasynchfunc(param1,param2, function(p4){ | |
console.log(p4); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment