title: How to get index of duplicate rows based on multiple columns javascript?
body: <p>I have the below array</p>
  <pre><code>const dummyData =[
  {
  &quot;plateID&quot;:&quot;1234567&quot;,
  &quot;freezer&quot;:&quot;fridzer A&quot;,
  &quot;shelf&quot;:&quot;1&quot;,
  &quot;box&quot;:&quot;1&quot;,
  &quot;position&quot;:&quot;1&quot;,
  },
  {
  &quot;plateID&quot;:&quot;1234567&quot;,
  &quot;freezer&quot;:&quot;fridzer B&quot;,
  &quot;shelf&quot;:&quot;1&quot;,
  &quot;box&quot;:&quot;1&quot;,
  &quot;position&quot;:&quot;1&quot;,
  },
  {
  &quot;plateID&quot;:&quot;1234567&quot;,
  &quot;freezer&quot;:&quot;fridzer C&quot;,
  &quot;shelf&quot;:&quot;12&quot;,
  &quot;box&quot;:&quot;11&quot;,
  &quot;position&quot;:&quot;13&quot;,
  },
  {
  &quot;plateID&quot;:&quot;1234567&quot;,
  &quot;freezer&quot;:&quot;fridzer A&quot;,
  &quot;shelf&quot;:&quot;1&quot;,
  &quot;box&quot;:&quot;1&quot;,
  &quot;position&quot;:&quot;1&quot;,
  },
  {
  &quot;plateID&quot;:&quot;1234567&quot;,
  &quot;freezer&quot;:&quot;fridzer A&quot;,
  &quot;shelf&quot;:&quot;5&quot;,
  &quot;box&quot;:&quot;2&quot;,
  &quot;position&quot;:&quot;3&quot;,
  },
  {
  &quot;plateID&quot;:&quot;1234567&quot;,
  &quot;freezer&quot;:&quot;fridzer C&quot;,
  &quot;shelf&quot;:&quot;12&quot;,
  &quot;box&quot;:&quot;11&quot;,
  &quot;position&quot;:&quot;13&quot;,
  },
  ]
  </code></pre>
  <p>I want to match &quot;freezer&quot;,&quot;shelf&quot;,&quot;box&quot;,&quot;position&quot; value and find the index of duplicate value.</p>
  <p>The output will be like</p>
  <pre><code>[
    0,
    2,
    3,
    5
  ]
  </code></pre>
  <p>I have tried the below approach but only able to match one column at a time (Not all columns)</p>
  <pre><code>let duplicates = [];
  let tempArray = {};
  
  dummyData.forEach((item, index) =&gt; {
  
      tempArray[item.freezer] = tempArray[item.freezer] || [];
  
      tempArray[item.freezer].push(index);
  
  });
  
  for (var key in tempArray) {
  
      if (tempArray[key].length &gt; 1) {
  
          duplicates = duplicates.concat(tempArray[key]);
  
      }
  
      console.log(duplicates);
      console.log(tempArray);
  }
  </code></pre>
  <p>Is there ay way to match all four columns at a time and find the index of duplicate value ?</p>