code: function map(ary, each, done) {
    var result = new Array(ary.length);
    var next = after(ary.length, done);
  
    for (var i = 0; i < ary.length; i++) {
      each(ary[i], function(error, msg) {
        result[i] = msg;
        next(error, result);
      });
    }
  }
docs: Async array map using after