Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var someAsync = function(color, clb) {
- setTimeout(function() {
- clb(null, color + "_changed")
- }, 1);
- };
- var colors = ['red', 'green', 'blue'];
- colors.map(function(color) {
- someAsync(color, function(err, result) {
- console.log(color, "result:", result)
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement