title: Why do booleans behave differently in module js vs common js?
body: <p>I have a quick script that I initially wrote in common.js and when it was finished I wanted to write a driver script showing the function and changed the type to module.js.</p>
  <p>The script traverses a graph to find the shortest path and I keep track of visited nodes using an array, with elements set to true/false if it was visited.</p>
  <p>The values for every visit are set to false:</p>
  <pre><code>  let visit = new Array(9);
  
    for (let i = 0; i &lt;= 8; i++) {
      visit[i] = new Array(9); 
      for (let j = 0; j &lt;= 8; j++) {
        visit[i][j] = false;
      }
    }
  </code></pre>
  <p>The root node visit is changed to true:</p>
  <pre><code>visit[(rootNode[0], rootNode[1])] = true;
  </code></pre>
  <p>Then as the script progresses, touched nodes are changed to true which is where the error happens.</p>
  <pre><code>visit[x][y] = true;
  </code></pre>
  <p>Running the script in common.js gives the correct output. Running the script in module.js throws an error, saying:</p>
  <blockquote>
  <p>TypeError: Cannot create property '1' on boolean 'true'</p>
  </blockquote>
  <p>Where 1 is the x value of the visited node.</p>
  <p>Why is the behavior different?</p>
  <p>Edit: The issue was with ES6 Modules requiring strict mode. My typo with the parenthesis worked perfectly fine in CommonJS on the edge cases I was testing but not on the regular tests. Fixing the typo made it work everywhere, thanks for the help.</p>