title: understanding javascript advanced syntax, and object notation
body: <p>So I can across this neat helper function and was getting confused with the syntax. There is a variable (bool declared as true, which appears to be an array. Its using the bracket object notation, but then going to compare if bool[j] or [i] is true yet, there is nothing adding [i] or [j] to the object map. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const helper = (word, words) =&gt; {
  
      let bool = [true]; 
     //if you console.log(typeof bool) returns object ?? 
  
  
  
  
      //This comes out as an Obj at first glance I thought it was an arr, but its bracket notation
      for (var i = 1; i &lt;= word.length; i++) {
       
          for (var j = 0; j &lt;= i; j++) {
            //how is bool[j] being evaluated? or i if its an obj? 
              if (bool[j] === true &amp;&amp; words[word.substring(j, i)] === true) {
                  bool[i] = true;
                  break;
              } else {
                  bool[i] = false;
              }
  
          }
      }
      return console.log(bool[word.length] ? true : false);
  }
  
  
  helper('aa', ['aa', 'aabb', 'someotherword']);</code></pre>
  </div>
  </div>
  </p>