title: Adding onto float within json object
body: <p>So I have a JSON object that is dynamically creates based on lots. I'm trying to get the total cost of each lot. Each object in the list is a different purchase.</p>
  <pre><code>var lot_list = [{lot:123456,cost:'$4,500.00'}, {lot:654321, cost:'$1,600.00'}, {lot:123456, cost:'$6,500.00'}]
  </code></pre>
  <p>I want the total cost for each lot so I tried</p>
  <pre><code>var totalBalances = {};
  function addBalance(){
      lot_list.forEach(function(lots){
          totalBalances[lots[lot]] += parseFloat(lots['cost'].replace('$','').replace(',',''));
      });
  }
  </code></pre>
  <p>This ends with every lot having a null cost
  I also tried</p>
  <pre><code>var totalBalances = {};
  function addBalance(){
      lot_list.forEach(function(lots){
          totalBalances[lots[lot]] = parseInt(totalBalances[lots[lot]]) + parseFloat(lots['cost'].replace('$','').replace(',',''));
      });
  }
  </code></pre>
  <p>Neither of these worked any help is much appreciated.</p>