How to map an object as per key and value using Javascript : I want to group an array of objects by an object key then create a new array of objects based on the grouping. I am explaining my object below.

    var oldArr=[
                {
                  "id":"5c407834953d7f420d56f866",
                  "allocated_to":"FIELD",
                  "zone":"NORTH",
                  "state":"DELHI",
                  "location":"NEW DELHI",
                  "customer_name":"REET INFOTECH"
                },
                {
                  "id":"5c407834953d7f420d56f867",
                  "allocated_to":"FIELD",
                  "zone":"NORTH",
                  "state":"JK",
                  "location":"Sree Nagar",
                  "customer_name":"REET"
                },
                {
                  "id":"5c407834953d7f420d56f868",
                  "allocated_to":"FIELD",
                  "zone":"EAST",
                  "state":"Odisha",
                  "location":"Bhubaneswar",
                  "customer_name":"REET"
                }
    ]

I need to make new array which should be group by `zone,state,location` and format is given below.

    newdata={
              zone_list: [{
                zone: NORTH,
                state_list: [{    
                  state: DELHI,
                  location_list: [{
                    location: NEW DELHI,
                    task_list: [{
                      user_pkId: 5c407834953d7f420d56f866,
                      loan_accounts_assigned: [{
                        customer_name: REET INFOTECH,
                      }]
                    }]
                  }]
                },{
                  state: JK,
                  location_list: [{
                    location: Sree Nagar,
                    task_list: [{
                      user_pkId: 5c407834953d7f420d56f867,
                      loan_accounts_assigned: [{
                        customer_name: REET
                      }]
                    }]
                  }]
                }]
              },{
                zone: EAST,
                state_list: [{    
                  state: Odisha,
                  location_list: [{
                    location: Bhubaneswar,
                    task_list: [{
                      user_pkId: 5c407834953d7f420d56f868,
                      loan_accounts_assigned: [{
                        customer_name: REET
                      }]
                    }]
                  }]
                }]
              }]
            }

I need the above output format after grouping.