title: Javascript: Array undefined is not an object
body: <p>Sorry if this question was already asked. I found undefined errors but not for array so heres my question:</p>
  
  <p>I get an 'undefined is not an object' error when im trying to declare selRef41 with the given Array. 
  (btw Im using ESTK and i am writing this script for Photoshop)</p>
  
  <pre><code>var docRef = app.activeDocument;
  var layRef = docRef.activeLayer;
  
  function createSelection(layRef) {
  // Declare function variables
  const oneT = 1/3;
  const twoT = (1/3)*2;
  
  docRef = app.activeDocument;
  layRef = app.activeLayer;
  
  if (detailFactor == "2x2") {
      var selRef41 = Array(Array(0, 0),
                          Array(layRef.width.value / 2, 0),
                          Array(layRef.width.value / 2, layRef.height.value / 2),
                          Array(0, layRef.height.value / 2));
  }
  </code></pre>
  
  <p>The corresponding main is just a one-liner to call the function:</p>
  
  <pre><code>function main() {
  createSelection(layRef);
  }
  </code></pre>