Created
June 11, 2015 12:19
-
-
Save cowboy/2c44253816efb3470156 to your computer and use it in GitHub Desktop.
JavaScript: Does My Async Abstraction Work? Per https://twitter.com/ryanflorence/status/608841603956903937
This file contains hidden or 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.prototype.doesMyAsyncAbstractionWork = function() { | |
var fn = this; | |
var args = arguments; | |
setTimeout(function() { | |
fn.apply(null, args); | |
}, Math.random() * 5000); | |
}; |
This file contains hidden or 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
for (var i = 0; i < 10; i++) { | |
console.log.bind(console).doesMyAsyncAbstractionWork("hello %d", i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment