Skip to content

Instantly share code, notes, and snippets.

@SteGriff
Created December 16, 2016 14:58
Show Gist options
  • Select an option

  • Save SteGriff/36200a1ec6885cadc8c3faa87cccd772 to your computer and use it in GitHub Desktop.

Select an option

Save SteGriff/36200a1ec6885cadc8c3faa87cccd772 to your computer and use it in GitHub Desktop.
A javascript callback puzzle, or, why we prefer Promises to Callbacks
function a(callback)
{
console.log("a");
callback();
}
function b(callback)
{
console.log("b");
callback();
}
function c()
{
console.log("c");
}
a(b(c));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment