title: How to group object inside array
body: <p>Here is what I have</p>
  <pre><code> [
     {
       typeProgramId: {
         name: 'type1',
       },
       title: 'test1',
     },
     {
       typeProgramId: {
         name: 'type1',
       },
       subTypeProgramId: [{
         name: 'sub1',
       }],
       title: 'test2',
     },
    {
       typeProgramId: {
         name: 'type2',
       },
       title: 'test3',
     },
     {
       typeProgramId: {
         name: 'type2',
       },
       subTypeProgramId: {
         name: 'sub2',
       },
       title: 'test4',
     }
   ]
  </code></pre>
  <p>First I want to group typeProgramId  if the title have the same typeProgramId I want to push title into array by each typeProgramId but If the data have typeProgramId and subTypeProgram Id I want to group subtypeProgramId in typeProgramId too. if not empty subtypeProgramId I want to push it in array title inside subtypeProgram Id. I try to use lodash groupBy and many way but it still did not work.</p>
  <p>Here is what I want</p>
  <pre><code>{
      typeProgramId: [{
          name: 'type1',
          title: [
              'test1',
          ],
          subTypeProgramId: {
              name: sub1,
              title: [
                  'test2'
              ]
          }
      }, {
          name: 'type2',
          title: [
              'test3',
          ],
          subTypeProgramId: [{
              name: sub1,
              title: [
                  'test4'
              ]
          }
      }]
  }
  </code></pre>
  <p>what I do now</p>
  <pre><code>  let result = _.groupBy(getProgram, function(data) {
      return data.typeProgramId
    })
    result = _.map(result, function(group, data) { 
      // I think in here I must groupBy subTypeProgramId again 
      // the data return all string not object after group 
      return {
        typeProgramId: data,
        titile: group,
      }
    })
  </code></pre>