title: Change the key of an object with one attribute from its values
body: <p>Having an array of objects with this structure:</p>
  
  <pre><code>[
      {
          key: id,
          value: id, name, type
      },
      {   key: id,
          value: id, name, type
      },
      {   key: id,
          value: id, name, type
      }
  ];
  </code></pre>
  
  <p>The key used is the id. There could be more groups of values for the same id, like:</p>
  
  <pre><code>{ 132: Array(1), 243: Array(1), 389: Array(3)}
      132: Array(1)
          0: eqKey: "abc", id: 132, name: "name1"
      243: Array(1)
          0: eqKey: "ccc", id: 243, name: "name2"
      389: Array(3)
          0: eqKey: "vcv", id: 389, name: "name3"
          1: eqKey: "tre", id: 389, name: "name4"
          2: eqKey: "ace", id: 389, name: "name5"
  </code></pre>
  
  <p>My question is if it's a way to "regroup" the structure, instead of being grouped by id to be grouped by type. (Type is unique)</p>
  
  <p>So the final form for the above example would look like this:</p>
  
  <pre><code>{"abc": Ar(1), "ccc": Ar(1), "vcv": Ar(1), "tre": Ar(1), "ace": Ar(1)}  
      "abc": Array(1)
          0: eqKey: "abc", id: 132, name: "name1" 
      "ccc": Array(1)
          0: eqKey: "ccc", id: 243, name: "name2"
      "vcv": Array(1)
          0: eqKey: "vcv", id: 389, name: "name3"
      "tre": Array(1)
          0: eqKey: "tre", id: 389, name: "name4"
      "ace": Array(1)
          0: eqKey: "ace", id: 389, name: "name5"
  </code></pre>