title: Clubbing Objects based on condition in array of objects
body: <p>I have an Array of Objects like this</p>
  
  <pre><code>const obj = [
    {
      id: 1,
      name: "Abc"
    },
    {
      id: 2,
      name: "BED"
    },
    {
      id: 1,
      name: "FGH"
    },
    {
      id: 3,
      name: "RFS"
    },
    {
      id: 1,
      name: "Abc"
    },
    {
      id: 2,
      name: "BGH"
    }
  ]
  </code></pre>
  
  <p>I want to club the objects who have <strong>same id and same name</strong> so that my Final output looks like this-</p>
  
  <pre><code>const result = [
    [
      {
        id: 1,
        name: "Abc"
      },
      {
        id: 1,
        name: "Abc"
      }
    ],
    [
      {
        id: 1,
        name: "TSD"
      }
    ],
    [
      {
        id: 2,
        name: "BED"
      }       
    ],
    [
        {
        id: 2,
        name: "BGH"
      }
    ],
    [
      {
        id: 3,
        name: "RFS"
      }
    ]
  ]
  </code></pre>
  
  <p><strong>Note - I have about 300-400 objects in the array and I have used nested For loops to solve this problem. Therefore I am looking for a better and fast solution</strong></p>