Speed up development with full-stack environments for every branch.

Learn More

async map example [Node.js]

Forked from Hello World for Node.js.

7190 Runs 21696 Views 5550 Copies
Saved

Saved

wenqer 1

wenqer
published 3 years ago

    var async = require('async');
    
    var arr = ['1','2'];
    async.map(arr, getInfo, function (e, r) {
      console.log(r);
    });
    
    function getInfo(name, callback) {
      setTimeout(function() {
        callback(null, name + 'new');
      }, 1000);
    }
    Please login/signup to get access to the terminal.

    Your session has timed out.

    Dismiss (the page may not function properly).