title: Build query string in javascript and merge params in one param
body: <p>So the issue here is I want to be able to build a query string and nest different params in one of the params in Javascript. I am able to do this in php using http_build_query function. I tried doing it in javascript but params are getting splitted by &amp;.
  Here's my php code</p>
  
  <pre><code>$query string = [
              'action'      =&gt; 'index',
              'url'         =&gt; '/test/app/sell.php?'. http_build_query([
                  'id'      =&gt; $id,
                  'name'    =&gt; $name,
                  'state'   =&gt; $currentState,
                  'p'   =&gt; 1,
              ])
          ));
  </code></pre>
  
  <p>which returns</p>
  
  <pre><code>url: "/test/app/sell.php?id=10&amp;name=john&amp;state=CA&amp;p=1"
  </code></pre>
  
  <p>Here's my js url but it seperates the params. </p>
  
  <pre><code>url = "url=/test/app/sell.php?"&amp;id=" + id + "&amp;name=" + name + "&amp;state=" + form_name + "&amp;p=" + 1"
  </code></pre>
  
  <p>which returns:</p>
  
  <pre><code>id: 2,
  name: "john",
  state: "CA",
  p: 1,
  url: "/test/app/sell.php?"
  </code></pre>
  
  <p>How can i add all the params to the url param and it should return something like this <code>url: "/test/app/sell.php?id=10&amp;name=john&amp;state=CA&amp;p=1"</code></p>