How would I split the following array using javascript? what I want to do here is split this array into multiple arrays inside this array which should be unique by 1, 2, 3, 4, 5 candidateConfigId
0: {candidateConfigId: "1", value: "199128700790"}
1: {candidateConfigId: "2", value: "Yujith"}
2: {candidateConfigId: "3", value: "Male"}
3: {candidateConfigId: "4", value: "SE"}
4: {candidateConfigId: "5", value: "Colombo5"}
5: {candidateConfigId: "1", value: "199128700792"}
6: {candidateConfigId: "2", value: "Yujith2"}
7: {candidateConfigId: "3", value: "Male"}
8: {candidateConfigId: "4", value: "SE"}
9: {candidateConfigId: "5", value: "Colombo3"}
10: {candidateConfigId: "1", value: "199128700793"}
11: {candidateConfigId: "2", value: "Yujith3"}
12: {candidateConfigId: "3", value: "Male"}
13: {candidateConfigId: "4", value: "SE"}
14: {candidateConfigId: "5", value: "Colombo2"}
Expected output
[
[
0: {candidateConfigId: "1", value: "199128700790"}
1: {candidateConfigId: "2", value: "Yujith"}
2: {candidateConfigId: "3", value: "Male"}
3: {candidateConfigId: "4", value: "SE"}
4: {candidateConfigId: "5", value: "Colombo5"}
],
[
0: {candidateConfigId: "1", value: "199128700792"}
1: {candidateConfigId: "2", value: "Yujith2"}
2: {candidateConfigId: "3", value: "Male"}
3: {candidateConfigId: "4", value: "SE"}
4: {candidateConfigId: "5", value: "Colombo3"}
],
[
10: {candidateConfigId: "1", value: "199128700793"}
11: {candidateConfigId: "2", value: "Yujith3"}
12: {candidateConfigId: "3", value: "Male"}
13: {candidateConfigId: "4", value: "SE"}
14: {candidateConfigId: "5", value: "Colombo2"}
]
]
Thanks in advance