title: How to convert URL parameters to a JavaScript object?
body: <p>I have a string like this:</p>
  
  <pre><code>abc=foo&amp;def=%5Basf%5D&amp;xyz=5
  </code></pre>
  
  <p>How can I convert it into a JavaScript object like this?</p>
  
  <pre><code>{
    abc: 'foo',
    def: '[asf]',
    xyz: 5
  }
  </code></pre>