title: How to get array parameter value from URL in javascript
body: <p>How can get value from URL in javascript, the parameter is in array what can I do please help me and thanks in advance my code and URL is below:</p>
  
  <p>URL is :</p>
  
  <pre><code>propertyList?address=&amp;sub_type%5B%5D=3&amp;sub_type%5B%5D=6&amp;min_price=
  </code></pre>
  
  <p>I want <code>sub_type</code> value, I got other parameter value which are single and not in array with this function :</p>
  
  <pre><code>var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = decodeURIComponent(window.location.search.substring(1)),
      sURLVariables = sPageURL.split('&amp;'),
      sParameterName,
      i;
  
    for (i = 0; i &lt; sURLVariables.length; i++) {
      sParameterName = sURLVariables[i].split('=');
  
      if (sParameterName[0] === sParam) {
        return sParameterName[1] === undefined ? true : sParameterName[1];
      }
    }
  };
  </code></pre>
  
  <p>I used this function and got the value of <code>address</code> and <code>min_price</code> value but it is not working in <code>sub_type</code>. </p>
  
  <p>What can I do to get <code>sub_type</code> value?</p>