title: Async iterator gives TypeError: undefined is not a function
body: <p>I am trying to learn how to use the async module in node.js and I fall into to the following problem:</p>
  
  <p>I first wrote this script which works fine (to my understanding)</p>
  
  <pre><code>var async = require('async');
  var seconds_values = [];
  
  process();
  
  function process() {
      var names = ['One', 'Two', 'ten', 'hello'];
  
      modifications(names);
  }
  
  function modifications(somenames) {
      async.each(somenames, function (one_name, callback) {
          var random_num = Math.floor((Math.random() * 100000000) + 1);
  
          seconds_values.push(one_name + '_' + random_num);
          callback();
      }, function(err){
          async.each(seconds_values, function (one_value, callback) {
              console.log(one_value);
              callback();
          },
          function(err){
              console.log('==== The END ===');
          });
      });
  }
  </code></pre>
  
  <p>The I tried to assign the iterator to a variable, to make the code more readable.</p>
  
  <pre><code>var async = require('async');
  var seconds_values = [];
  
  process();
  
  function process() {
      var names = ['One', 'Two', 'ten', 'hello'];
  
      modifications(names);
  }
  
  var first_function = function (one_name, callback) {
      var random_num = Math.floor((Math.random() * 100000000) + 1);
  
      seconds_values.push(one_name + '_' + random_num);
      callback();
  }
  
  function modifications(somenames) {
      async.each(somenames, first_function, function(err){
          async.each(seconds_values, function (one_value, callback) {
              console.log(one_value);
              callback();
          },
          function(err){
              console.log('==== The END ===');
          });
      });
  }
  </code></pre>
  
  <p>The second script gives me the following error:</p>
  
  <pre><code>iterator(x, only_once(done) );
          ^
  TypeError: undefined is not a function
  </code></pre>
  
  <p>I think I am missing something fundamental here. Could you please point me out what, if possible? </p>