title: pop() is not a function - nodejs
body: <p>I am having a strange error with NodeJS when I call the function <code>pop()</code> on an array, it says <code>TypeError: cars.pop is not a function</code>... I am confused.</p>
  
  <p>Any help? Below is the code. Thank you,</p>
  
  <pre><code>//callback chaining to avoid having multiple callbacks in the event queue
  //only one callback calling others
  function showCar(car, callback) {
    console.log('Saw a ' + car);
    if (car.length) {
      //register the function as asynchronous
      process.nextTick(function() {
        callback();
      })
    }
  }
  
  function logCars(cars) {
    var car = cars.pop();
    showCar(car, function() { //chaining of call backs
      logCars(car);
    });
  }
  var cars = ['ferrari', 'porsh', 'Hyundai', 'Peugeot'];
  logCars(cars);
  </code></pre>