Skip to content

Instantly share code, notes, and snippets.

@dvideby0
Last active December 14, 2015 14:58
Show Gist options
  • Save dvideby0/5104045 to your computer and use it in GitHub Desktop.
Save dvideby0/5104045 to your computer and use it in GitHub Desktop.
Simple example explaining how to work with callbacks..
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