Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. var someAsync = function(color, clb) {
  2. setTimeout(function() {
  3. clb(null, color + "_changed")
  4. }, 1);
  5. };
  6.  
  7. var colors = ['red', 'green', 'blue'];
  8.  
  9. colors.map(function(color) {
  10. someAsync(color, function(err, result) {
  11. console.log(color, "result:", result)
  12. });
  13.  
  14. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement