title: Make the difference between two arrays of objects in Javascript
body: <p>I have 2 arrays: </p>
  
  <pre><code>oldPerimeter:[
      {"meterID":"24348480450805","conso_prod":"Conso"},
      {"meterID":"24348769886471","conso_prod":"Conso"},
      {"meterID":"30002431659877","conso_prod":"Conso"},
  ]
  
  
  newPerimeter:[
      {"meterID":"24348480450805","conso_prod":"Conso"},
      {"meterID":"30002431659877","conso_prod":"Conso"},
      {"meterID":"24327496366232","conso_prod":"Conso"},
      {"meterID":"24329232979894","conso_prod":"Conso"},
      {"meterID":"24328075237474","conso_prod":"Conso"}
  ]
  </code></pre>
  
  <p>I would like to get the element that are presents in oldPerimeter that are not present in newPerimeter</p>
  
  <p>In my case, it should return:</p>
  
  <pre><code>elementsToDelete:[
     {"meterID":"24348769886471","conso_prod":"Conso"}
  ]
  </code></pre>
  
  <p>and if I do it from new to old, I should get: </p>
  
  <pre><code>elementsToCreate:[
     {"meterID":"24327496366232","conso_prod":"Conso"},
     {"meterID":"24329232979894","conso_prod":"Conso"},
     {"meterID":"24328075237474","conso_prod":"Conso"}
  ]
  </code></pre>
  
  <p>I could do it with a loop <code>foreach</code>, but I know there is a bunch of functions about arrays in Javascript, is there any better function that make the solution more elegant ?</p>
  
  <p>I don't need an efficient way to do it, I will prefer an elegant way to do it</p>