title: Get the difference two objects by subtracting properties
body: <p>I am trying to get the difference between two objects</p>
  
  <pre><code>previousChart: {BWP: 1, ZAR: 1.3, USD: 0.09324, number: 1},
  currentChart: {BWP: 1, ZAR: 1.35, USD: 0.01, number: 2}
  </code></pre>
  
  <p>The desired answer is:</p>
  
  <pre><code>newObject ={BWP: 0, ZAR: 0.05, USD: 0.08324, number: -1}
  </code></pre>
  
  <p>Please don't ask me what I have done as this is the last stage because this is the last part of my code, if you are interested in knowing what I have done here it is: </p>
  
  <pre><code>rates = [
  {BWP: 1, ZAR: 1.3, USD: 0.09324, number: 1},
  {BWP: 1, ZAR: 1.35, USD: 0.01, number: 2},
  {BWP: 1, ZAR: 1.3456, USD: 0.09234, number: 3},
  {BWP: 1, ZAR: 1.27894, USD: 0.06788, number: 4}
  ]
  
  newRate = [];
  
  for(let i in rates){
  
      if( i - 1 === -1 ){
          previousChart = rates[0];
      }else{
          previousChart = rates[i - 1];
      }
      let currentChart = rates[i];
  
  }
  </code></pre>