title: Why does my JavaScript function accept three arrays, but not an array containing three arrays?
body: <pre><code>function product() {
      return Array.prototype.reduce.call(arguments, function(as, bs) {
          return [a.concat(b) for each (a in as) for each (b in bs)]
      }, [[]]);
  }
  
  
  arr4=[['4','4A','4B'],['16D','15D'],['5d','5e']];
  alert(product(['4','4A','4B'],['16D','15D'],['5d','5e']);
  </code></pre>
  
  <p>The above works but the following don't work:</p>
  
  <pre><code>arr4=[['4','4A','4B'],['16D','15D'],['5d','5e']];
  alert(product(arr4);
  </code></pre>
  
  <p>Thanks for suggestions</p>