title: Angularjs Controller sets different value to object than assigned
body: <p>in one of the projects that I am working on, I am fetching Invoice Items from a REST API and filling them in their respective fields. But something unusual is happening. When i try to assign a float value sent from REST, angular assigns it as 0. </p>
  
  <p>To explain my problem clearly , consider the following</p>
  
  <pre><code>$scope.commodities = {
      items: [],
      total: 0,
      total_gst: 0
  };
  
  for (var i = 0; i &lt; $scope.output.data.length; i++) { //$scope.output is the response from REST API
  
      var itms = {};
      itms.item_description = $scope.output.data[i].item_description;
      itms.currency = $scope.output.data[i].currency;
      itms.amount = parseFloat($scope.output.data[i].amount);
      itms.ex_rate = parseFloat($scope.output.data[i].ex_rate);
      itms.tax = parseFloat($scope.output.data[i].tax);
      itms.quantity = parseFloat($scope.output.data[i].quantity);
      itms.total_without_gst = parseFloat($scope.output.data[i].total_without_gst);
      itms.gst = parseFloat($scope.output.data[i].gst);
      itms.total_with_gst = parseFloat($scope.output.data[i].total_with_gst);
      console.log(itms.total_without_gst); //displays correct value
      console.log(itms) //displays total_with_gst,total_without_gst as 0
      $scope.commodities.items.push(itms); 
  
  }
  </code></pre>
  
  <p>REST API Response</p>
  
  <pre><code>{
      "status": true,
      "data": [
          {
              "item_description": "Ocean freight",
              "currency": "USD",
              "tax": 0,
              "amount": 150,
              "ex_rate": 4.42,
              "quantity": 1,
              "total_without_gst": 663,
              "gst": 0,
              "total_with_gst": 663
          },
          {
              "item_description": "DG charges",
              "currency": "USD",
              "tax": 0,
              "amount": 80,
              "ex_rate": 4.42,
              "quantity": 1,
              "total_without_gst": 353.6,
              "gst": 0,
              "total_with_gst": 353.6
          }
      ]
  }
  </code></pre>
  
  <p>I have attached the console screenshot for your reference
  <a href="https://i.stack.imgur.com/4erAN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4erAN.jpg" alt="Screenshot"></a></p>