title: Plain Javascript Equivalent of jQuery.param()
body: <p><a href="http://api.jquery.com/jquery.param/" rel="noreferrer" title="jQuery.param&#40;&#41;">jQuery.param()</a> takes an array of key-value pairs, and turns it into a string you can use as a query string in HTML requests. For example, </p>
  
  <pre><code>a = {
        userid:1,
        gender:male
      }
  </code></pre>
  
  <p>would get converted to </p>
  
  <pre><code>userid=1&amp;gender=male
  </code></pre>
  
  <p>I'm trying to call external APIs on the server side in a Google Apps script, which need long query strings. I would use the jQuery param function, but there seems to be no easy way to use jQuery on the server side in Google. </p>
  
  <p><strong>Could you give me plain javascript code that achieves the same functionality?</strong> </p>
  
  <p>The jQuery implementation of it is <a href="https://github.com/jquery/jquery/blob/2e10af143b7eafb7142524f6534a62aee1910bd1/src/ajax.js#L507" rel="noreferrer">here</a>, but I don't want to take chances skipping over any crucial details by simply copying it and ripping out the code dealing with 'traditional'.</p>