title: Merge two object based on id property in JavaScript
body: <p>Original array getting from response:</p>
  
  <pre><code>result = [
      {
          id: 1,
          a: "one",
          b: "two",
          c: "three",
          d: "four",
      },
      {
          id: 1,
          a: "five",
          b: "six",
          c: "seven",
          d: "eight",
      }
  ]
  </code></pre>
  
  <p>I want result which is mentioned below. Please do the needful. Thanks in advance</p>
  
  <pre><code>newResult = [
      {
          id: 1,
          newArr: [{
              a: "one",
              b: "two",
              c: "three",
              d: "four",
          }, {
              a: "five",
              b: "six",
              c: "seven",
              d: "eight",
          }]
      }
  ]
  </code></pre>