title: get values from table as key value pairs with jquery
body: <p>I have a table:</p>
  
  <pre><code>&lt;table class="datatable" id="hosprates"&gt;
                  &lt;caption&gt; hospitalization rates test&lt;/caption&gt; &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th scope="col"&gt;Funding Source&lt;/th&gt; &lt;th scope="col"&gt;Alameda County&lt;/th&gt; &lt;th scope="col"&gt;California&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;tr&gt;
                          &lt;th scope="row"&gt;Medi-Cal&lt;/th&gt;
                          &lt;td&gt;34.3&lt;/td&gt;
                          &lt;td&gt;32.3&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;th scope="row"&gt;Private&lt;/th&gt;
                          &lt;td&gt;32.2&lt;/td&gt;
                          &lt;td&gt;34.2&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;th scope="row"&gt;Other&lt;/th&gt;
                          &lt;td&gt;22.7&lt;/td&gt;
                          &lt;td&gt;21.7&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>i want to retrieve column 1 and column 2 values per row as pairs that end up looking like this [funding,number],[funding,number]</p>
  
  <p>i did this so far, but when i alert it, it only shows [object, object]... </p>
  
  <pre><code>  var myfunding =  $('#hosprates tbody tr').each(function(){
    var funding = new Object();
  
    funding.name = $('#hosprates tbody tr td:nth-child(1)').map(function() {
                return $(this).text().match(/\S+/)[0];
               }).get();
    funding.value= $('#hosprates tbody tr td:nth-child(2)').map(function() {
                return $(this).text().match(/\S+/)[0];
               }).get();
  
  });
  alert (myfunding);
  </code></pre>