title: How can I convert 1 dimensional array into 2 dimensional array based on certain key in javascript?
body: <p>My code in javascript like this :</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var test = {
          "0": {
              "parent_category_id": "1",
              "parent_category_name": "Asia",
              "id": "4",
              "name": "Japan"
          },
          "1": {
              "parent_category_id": "1",
              "parent_category_name": "Asia",
              "id": "5",
              "name": "Korea"
          },
          "2": {
              "parent_category_id": "1",
              "parent_category_name": "Asia",
              "id": "6",
              "name": "Arab"
          },
          "3": {
              "parent_category_id": "2",
              "parent_category_name": "Europa",
              "id": "7",
              "name": "England"
          },
          "4": {
              "parent_category_id": "2",
              "parent_category_name": "Europa",
              "id": "8",
              "name": "Spain"
          },
          "5": {
              "parent_category_id": "2",
              "parent_category_name": "Europa",
              "id": "9",
              "name": "Italy"
          },
          "6": {
              "parent_category_id": "3",
              "parent_category_name": "America",
              "id": "10",
              "name": "Brazil"
          },
          "7": {
              "parent_category_id": "3",
              "parent_category_name": "America",
              "id": "11",
              "name": "Argentina"
          },
          "8": {
              "parent_category_id": "3",
              "parent_category_name": "America",
              "id": "12",
              "name": "Mexico"
          },
      };
      console.log(test);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>From the code :</p>
  
  <p>parent_category_id = 1, 2, 3</p>
  
  <p>parent_category_name = asia, europa, america</p>
  
  <p>id = 4, 5, 6, 7, 8, 9, 10, 11</p>
  
  <p>name = japan, korea, arab, england, spain, italy, brazil, argentina, mexico</p>
  
  <p>I want to display like this :</p>
  
  <pre><code>asia
     japan
     korea
     arab
  europa
     england
     spain
     italy
  america
     brazil
     argentina
     mexico
  </code></pre>
  
  <p>So I need to convert array one dimensional to be array two dimensional to display like that</p>
  
  <p>How can I do it?</p>