const students = [
{ name: "Alice", type: "l2info", mark: 15 },
{ name: "Bob", type: "DDI", mark: 8 },
{ name: "Charlie", type: "DDD", mark: 18 },
{ name: "David", type: "l2info", mark: 12 },
{ name: "Eve", type: "DDI", mark: 20 },
];
🥷Donnez le code pour obtenir :
{
l2info: [
{ studentname: 'Alice', type: 'l2info', mark: 15 },
{ studentname: 'David', type: 'l2info', mark: 12 }
],
DDI: [
{ studentname: 'Bob', type: 'DDI', mark: 8 },
{ studentname: 'Eve', type: 'DDI', mark: 20 }
],
DDD: [ { studentname: 'Charlie', type: 'DDD', mark: 18 } ]
}