title: Create li from loop through array and display to HTML as a list
body: <p>I am learning javaScript and I want to loop array and display to HTML as a list. How can I do that?</p>
  
  <p>Array:
  <code>
  var array = ['Slide 1', 'Slide 2', 'Slide 3', 'Slide 4', 'Slide 5', 'Slide 6', 'Slide 7', 'Slide 8', 'Slide 9'];
  </code></p>
  
  <p>javascript:</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>function listItem(item){
    for (var i = 0; i &lt; item.array.length; i++){
      var list = item.array[i];
      
      list = document.createElement('li');
      document.getElementByClass('box').appendChild(list);
      
      console.log(list);
    }  
   }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class ="box"&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>