title: make json array as new array for category and subcategory
body: <p>im working on django rest and angular this json array is comming from server ic contain category and subCategory values..
  im trying to build a dynamic navbar so i want to arrange this data like 
  <code>[
  [web development] : ["subCat1","subcat2",....]
  [android development] : ["subCat1","subcat2",....]
  ]</code>
  to access category and its related subctegory</p>
  
  <p>i tried somthing like this : but it set only keys and value are empety </p>
  
  <pre><code>  public categories = [[], [], [], []];
    public data;
        for (let i = 0; i &lt; this.data.length; i++) {
  
  
          if (this.data[i].cat_id != null) {
            this.categories[i][this.data[i].title] = [];
  
  
          }
          if (this.data[i].parent_id != null &amp;&amp; this.data[i].parent_id == this.data[i].cat_id) {
            this.categories[i][this.data[i].title] = [this.data[i].title]
          }
  
  
        }
  </code></pre>
  
  <p>its server response </p>
  
  <pre><code>  [
          {
              "id": 5,
              "cat_id": 0,
              "parent_id": null,
              "title": "web development"
          },
          {
              "id": 6,
              "cat_id": 1,
              "parent_id": null,
              "title": "android development"
          },
          {
              "id": 7,
              "cat_id": null,
              "parent_id": 0,
              "title": "php"
          },
          {
              "id": 8,
              "cat_id": null,
              "parent_id": 1,
              "title": "java"
          }
      ]
  </code></pre>