title: Node.js callbacks and recursion
body: <p>I don't understand how to call a function recursively in node.js for example:</p>
  
  <pre><code>var releaseStock = function (callback) {
  
    getItems(function (err, items) {
      if (err) {
        return callback(err);
      } else {
        if (items) {
          return callback(items);
        } else {
          setTimeout(function() {
            releaseStock(callback);
          }, 5000); 
        }
      }
    });
  };
  </code></pre>
  
  <p>How can i make it work?</p>