title: append comma seperated values to url as search params
body: <p>How to append comma seperated values to url as search params using history.pushsate. with use of , RFC 3986, specifies that URI path components should not contain unencoded reserved characters and comma is one of those reserved characters. <a href="https://www.rfc-editor.org/rfc/rfc3986" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc3986</a>.</p>
  <p>#code</p>
  <p>window.history.pushState('new', 'inventory', '/new');</p>
  <p>#Desired result</p>
  <pre><code>https://www.test.com/new?Year=2020,2019&amp;Pricerange=10001-20000,20001-30000,30001-40000&amp;Mileagerange=1001-2000,2001-3000&amp;Bodystyle=4dr%20Car,Convertible
  </code></pre>
  <p>#Data i wanted to append</p>
  <pre><code>{
    &quot;year&quot;: [
      &quot;2017&quot;,
      &quot;2018&quot;
    ],
    &quot;model&quot;: [
      &quot;Escape&quot;,
      &quot;Edge&quot;
    ],
    &quot;mileage&quot;: [
      &quot;1-1000&quot;
    ],
    &quot;bodyStyle&quot;: [
      &quot;Convertible&quot;,
      &quot;4dr Car&quot;,
      &quot;2dr Car&quot;
    ],
    &quot;priceRange&quot;: [
      &quot;$20,000-$30,000&quot;,
      &quot;$30,000-$40,000&quot;
    ]
  }
  </code></pre>