title: Create a <ul> and fill it based on a passed array
body: <p>I've managed to generate a series of list-items based on one specified array within a matrix (i.e. an array within an array).</p>
  
  <p>I would like to be able to pass a variable (representing an array) to a function so that it can spit out an unordered list filled with list-items based on the array passed into it.</p>
  
  <p><strong>Problems:</strong></p>
  
  <ul>
  <li>The function only works with one array at a time</li>
  <li>It also produces commas in the markup (presumably, because it's converting the array to a string)</li>
  </ul>
  
  <p><strong>The solution needs to:</strong></p>
  
  <ul>
  <li>assume that the unordered list does not exist in the DOM</li>
  <li>be able to accept different arrays passed into it (<code>options[0]</code>, <code>options[1]</code>, etc.)</li>
  <li>generate the list-items without commas</li>
  </ul>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>var options = [
          set0 = ['Option 1','Option 2'],
          set1 = ['First Option','Second Option','Third Option']
      ]
  
  function makeUL(){
      var a = '&lt;ul&gt;',
          b = '&lt;/ul&gt;',
          m = [];
  
      // Right now, this loop only works with one
      // explicitly specified array (options[0] aka 'set0')
      for (i = 0; i &lt; options[0].length; i += 1){
          m[i] = '&lt;li&gt;' + options[0][i] + '&lt;/li&gt;';
      }
  
      document.getElementById('foo').innerHTML = a + m + b;
  }
  
  // My goal is to be able to pass a variable
  // here to utilize this function with different arrays
  makeUL();
  </code></pre>
  
  <p><strong><a href="http://jsfiddle.net/sTLbj/2/" rel="noreferrer">jsFiddle</a></strong></p>