title: Uncaught RangeError: Invalid string length when appending to a string in JavaScript
body: <p>So basically I've been working on a small personal project of mine in Javascript, and I've hit a snag. I'm trying to generate a list in HTML from a 2D array using Javascript. Here is my code:</p>
  
  <pre><code>function generatePageFromArray(page, array){
  var entry, i, j;
  for (i = 0; i &lt; array.length; ++i) {
      entry = array[i];
      for (j = 0; j &lt; entry.length; j = j + 2) {
          page = page + '&lt;tr&gt;'+
                      '&lt;td class="favoritesContainer"&gt;&lt;input type="checkbox" class="favorites"&gt;&lt;/input&gt;&lt;/td&gt;';
          page = page +  '&lt;td class="english"&gt;' + entry[j,0] + '&lt;/td&gt;';
          page = page +  '&lt;td class="spanish"&gt;';
          if (entry[j,1].indexOf("|") &gt; 0){
              var spanishTerms = entry[j,1].split("|");
              var strLength = spanishTerms.size;
              for (i = 0; i &lt; strLength; i++){
                  page = page.concat(spanishTerms[i] + '&lt;br&gt;');   
              }
          }
          else{
              page = page + entry[j,1];
          }
          page = page + '&lt;/td&gt;'
          page = page + '&lt;/tr&gt;';         
      }
  }
  return page;}
  </code></pre>
  
  <p>It keeps throwing a Uncaught RangeError: Invalid string length on this line: </p>
  
  <pre><code>page = page + '&lt;tr&gt;'+
                      '&lt;td class="favoritesContainer"&gt;&lt;input type="checkbox" class="favorites"&gt;&lt;/input&gt;&lt;/td&gt;';
  </code></pre>
  
  <p>I have no idea why. I've also tried using .concat() to append, but nothing.</p>