I have the following data obtained from my server response:
var data = [
{
project: {
name: "KB",
$type: "Project"
}
},
{
project: {
name: "Test",
$type: "Project"
}
},
{
project: {
name: "Test",
$type: "Project"
}
},
{
project: {
name: "KB",
$type: "Project"
}
},
{
project: {
name: "Test",
$type: "Project"
}
},
{
project: {
name: "Test",
$type: "Project"
}
}
];
I need to prepare my data for the following steps. Ideally, I need to get the following output:
var aggregatedData = [
{
projectName: "KB",
count: 2
},{
projectName: "Test",
count: 4
},
];
Is it possible? If so, what is the best way to implement this using jQuery?