title: Javascript: .push is not a function
body: <p>I am having a problem with my code:</p>
  
  <pre><code>var arrays = [[1, 2, 3], [4, 5], [6]];
  console.log(reduce(arrays,function(array,b){
    return array.push(b);
  }));
  
  function reduce(array,combine){
    var current = [];
    for(var i = 0;i&lt;array.length;i += 1){
      current = combine(current,array[i]);
    }
    return current;
  }
  console.log(reduce([1, 2, 3, 4], function(array, b) {
    return array.push(b);
  }));
  
  // → [1, 2, 3, 4, 5, 6]
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>TypeError: array.push is not a function (line 3) 
  </code></pre>
  
  <p>As far as I understand, this is because it is treating the array argument as something other than an array. However, I thought I fed it the variable "current" which is an array. Can someone explain the problem? Thanks.</p>