Skip to content

Instantly share code, notes, and snippets.

@buley
Created March 20, 2014 17:48
Show Gist options
  • Save buley/9669739 to your computer and use it in GitHub Desktop.
Save buley/9669739 to your computer and use it in GitHub Desktop.
How I explained promises
var ryan = function() {
console.log('hey girl');
};
for ( var x = 0; x < 10; x += 1 ) {
(function(z) { var prev = ryan;
ryan = function() {
console.log('hey guy', z);
prev();
} }(x));
}
ryan();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment