title: lodash casting, mapping and picking
body: <p>I have an array of objects that I am simplifying as this:</p>
  
  <pre><code>var expenses = [
          {
            arm: "0",
            cat_id: "1",
            crop: {
              crop: "corn",
              id: 1
            },
            crop_id: "1",
            dist: "164.97",
            expense: "Fertilizer",
            id: "1",
            loan_id: "1"
          },
          {
            arm: "20",
            cat_id: "8",
            crop: {
              crop: "corn",
              id: 1
            },
            crop_id: "1",
            dist: "0",
            expense: "Labor",
            id: "8",
            loan_id: "1"
          }
        ];
  </code></pre>
  
  <p>I am trying to end up with this:</p>
  
  <pre><code>var expenses = [{
      arm: 0,
      cat_id: 1,
      crop: "corn",
      crop_id: 1,
      dist: 164.97,
      expense: "Fertilizer",
      id: 1,
      loan_id: 1
   },{
      arm: 20,
      cat_id: 6,
      crop: "corn",
      crop_id: 1,
      dist: 0,
      expense: "Labor",
      id: 1,
      loan_id: 1
  }];
  </code></pre>
  
  <p>I can get certain pieces in that direction but can't pull it all together without error. I can't find out how to cast the values to float or put crop INSIDE of stub because casted returns all nulls. I currently have this:</p>
  
  <pre><code>flattened = _.map(expenses, function(item){
          var crop = item.crop.crop;
          var stub = _.pick(item, [
              'id',
              'loan_id',
              'cat_id',
              'expense',
              'crop_id',
              'arm', 
              'dist'
            ]);
            var casted = _.map(stub, function(i){
              i.crop = crop;
              return i;
            });
            return stub;
        });
  </code></pre>
  
  <p>Any help is appreciated.</p>