How to group JavaScript Object in javascript

seek for help for grouping them. I got an input with this.

[
{
“apiName”: “APISend”,
“channel”: “Mozilla”,
“noa”: 3
},
{
“apiName”: “API”,
“channel”: “PostMan”,
“noa”: 1
},
{
“apiName”: “APICall”,
“channel”: “PostMan”,
“noa”: 4
},
{
“apiName”: “API”,
“channel”: “Mozilla”,
“noa”: 2
}
]

How can I group them as channel and then by apiName? My final output should be like this:

labels = [“Mozilla”,”PostMan”]

datasets = [{label:”APISend”, data:[3,0]} , {label:”API”,data:[2,1], {label:”APICall”,data:[0,4]]}