Skip to content

Instantly share code, notes, and snippets.

@s-ashwinkumar
Last active August 4, 2017 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-ashwinkumar/f279489e6ffaa2145edc48d6b58bb8fa to your computer and use it in GitHub Desktop.
Save s-ashwinkumar/f279489e6ffaa2145edc48d6b58bb8fa to your computer and use it in GitHub Desktop.
Sample code to demostrate async basics
function getStuff() {
var result;
jQuery.get("amazing/long/method"), function(response) {
result = response;
}
return result;
}
var stuff = getStuff();
console.log("This is THE stuff - "+ stuff);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment