How to reorganize array

there is an array like this

[
  {
     id:1,
     info: {name:"abc"}
     show: true
  },
 {
     id:2,
     info: {name:"abc"}
     show: true
  },
 {
     id:3,
     info: {name:"qq"}
     show: true
  }
 ]

then I want to reorganize array to put the same info.name in the same object like this. Is there a way to do that?

[
    
      {
        {
          id:1,
          info: {name:"abc"}
          show: true
       },
        {
          id:2,
          info: {name:"abc"}
          show: true
       },
      },
      
    
     {
         id:3,
         info: {name:"qq"}
         show: true
      }
     ]

Mar.19,2022

there is something wrong with the reorganized data


the structure in Object is the structure of key-value pairs.
if you want to classify, you can try the following formats

< H2 > first format < / H2 >
// ,
var newArr=Object.keys(obj).map(key=>obj[key].data)
is actually a simple application of native functions. It is recommended that you learn the basics well so that you can convert the data into the format you want according to your needs.
Menu