index.js
function (currency, callback) {
      // Call an asynchronous function, often a save() to DB
      self.getPricesForSingleCurrency(from, to, currency, function (err, result) {
        if (err) {
          callback(err)
        } else {
          ratesWithTimes[currency] = result
          callback()
        }
      })
    }
function (currency, callback) {
      // Call an asynchronous function, often a save() to DB
      self.getPricesForSingleCurrency(from, to, currency, function (err, result) {
        if (err) {
          callback(err)
        } else {
          ratesWithTimes[currency] = result
          callback()
        }
      })
    }
function ( currency , callback ) { // Call an asynchronous function, often a save() to DB self . getPricesForSingleCurrency ( from , to , currency , function ( err , result ) { if ( err ) { callback ( err ) } else { ratesWithTimes [ currency ] = result callback ( ) } } ) }
2nd param is the function that each item is passed to
2nd param is the function that each item is passed to