one array of object =
[{
"id": "5b2a4b0287bc2c082ebc2897",
"test_name": "BSF",
"test_type": "Pathology",
"cost": "100"
}, {
"id": "5b2a4ac63db998081e7f6c97",
"test_name": "Brain & PNS",
"test_type": "Radiology",
"cost": "1000"
}, {
"id": "5b2a4ac63db998081e22336c97",
"test_name": "BPNS",
"test_type": "Radiology",
"cost": "1000"
}]
I want to split this array of object into two separate array of object based on key value pair - "test_type"
O/p 1 st array
[{
"id": "5b2a4b0287bc2c082ebc2897",
"test_name": "BSF",
"test_type": "Pathology",
"cost": "100"
}]
2 nd array
[ {
"id": "5b2a4ac63db998081e7f6c97",
"test_name": "Brain & PNS",
"test_type": "Radiology",
"cost": "1000"
},{
"id": "5b2a4ac63db998081e22336c97",
"test_name": "BPNS",
"test_type": "Radiology",
"cost": "1000"
}]