title: Most efficient way to retrieve numbers from a querystring?
body: <p>I need to parse querystrings that contain both text and numbers. For example the following querystring:</p>
  
  <pre><code>?userID=12&amp;team=Sales&amp;quarter=Q1&amp;count=2310
  </code></pre>
  
  <p>should be translated into the following JavaScript object:</p>
  
  <pre><code>{
  userID:12, // not "12"
  team:"Sales",
  quarter:"Q1",
  count:2310 // not "2310"
  }
  </code></pre>
  
  <p>Currently I am doing it in two steps:</p>
  
  <ol>
  <li>Parse the querystring</li>
  <li>Go through all the parameters and identify which ones are numbers (either with a regex or an isNumber function <code>!isNaN(parseFloat(n)) &amp;&amp; isFinite(n)</code></li>
  </ol>
  
  <p>This seems rather inefficient especially as most of my parameters are not numbers. Is there a better way?</p>