title: Unable to pass an array as function argument in Javascript
body: <p>I am trying to pass an array as a function argument. When I run the HTML the browser displays a blank page. Please help:) (Obviously a coding noob)</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-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
    &lt;script&gt;
      var list = [7, 8, 9, 4];
  
      document.write(list);
  
      pass_array(array) {
        let sum = 0;
        for (let i = 0; i &lt; list.length; i++) {
          sum = +list[i];
        }
        document.write(sum);
      }
  
      pass_array(this, list);
    &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>