title: How do I create an array of items after outputting them all individually to the console?
body: <p>As you can see at the moment the result of the code is outputting each value of the options list to the console. However I want them to be grouped into an array variable rather than the code outputting it one by one. Any help is appreciated, thanks!</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($){
     $('.request-poc').attr('href', function() {
        var product = $(this).attr("data-product");
        return this.href + '?product=' + product;
     });
     if ($('body.request-poc').length &gt; 0)
     {
        function GetURLParameter(sParam)
        {
           var sPageURL = window.location.search.substring(1);
           var sURLVariables = sPageURL.split('&amp;');
           for (var i = 0; i &lt; sURLVariables.length; i++)
           {
                 var sParameterName = sURLVariables[i].split('=');
                 if (sParameterName[0] == sParam)
              {
                 return sParameterName[1];
              }
           }
        }
        var product = GetURLParameter('product');
        console.log(product)
        $('#product').val(product);
     }
  
     Array.from(document.querySelector("#product").options).forEach(function(option_element) {
        let option_value = option_element.value;
        console.log(option_value);
    }); 
  
  })(jQuery);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;body class='request-poc'&gt;
  
      &lt;h1&gt;Dummy&lt;/h1&gt;
  
      &lt;form action="#"&gt;
          &lt;select name="Select product" id="product"&gt;
              &lt;option value="SHOES"&gt;Shoes&lt;/option&gt;
              &lt;option value="SHIRT"&gt;Shirt&lt;/option&gt;
              &lt;option value="JUMPER"&gt;Jumper&lt;/option&gt;
              &lt;option value="SOCKS"&gt;Socks&lt;/option&gt;
              &lt;option value="JEANS"&gt;Jeans&lt;/option&gt;
              &lt;option value="OTHER"&gt;Other&lt;/option&gt;
          &lt;/select&gt;
      &lt;/form&gt;
  
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>