title: TypeError: Callback is not a function with asyncJS in nodeJS
body: <p>I want to write a function which calls itself with multiple synchronous calls (the code here is just a stripped example of the flow). The problem is that nodeJS is giving me a "TypeError: asyncCb is not a function". </p>
  
  <p>I researched this error and it seems that the parameter is returning something else than a function, but I cannot find the error in the code. I'm a new nodeJS developer so I might miss something obvious here...</p>
  
  <p>Thank you for your help!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var async = require('async');
  
  //number is an integer, deepdive defines if the function is called the first time or not, cb contains the regular callback, asynCb contains the asyncJS callback
  var asyncTester = function(number, deepdive, cb, asyncCb) {
      //check if function should nest itself -- only on the first call
      if (deepdive == true) {
          var funcArray = [];
          //load async with multiple calls of this function
          for (var times = 2; times &lt; 4; times++) {
              funcArray.push(function(callback) {
                  asyncTester(times, false, null, callback);
              });
          }
          //call async with array of functions and final callback handling
          async.series(funcArray,
              function(err, results) {
                  //return the original callback with the results from the async series
                  return cb(err, results);
              });
      }
      //return the async callback when in a nested call
      return asyncCb(null, number);
  };
  
  asyncTester(1, true, function(err, data) {
      //expect array of results with 1, 2, 3
      console.log(data);
  }, null);</code></pre>
  </div>
  </div>
  </p>