A simple array problem, ES6 how to solve gracefully, cute new call for help

let a = [ { name:"1", status:"1" }, { name:"2", status:"1" }, { name:"3", status:"2" }, { name:"4", status:"2" }, { name:"5", status:"3" }, { name:"6", status:"bbb" } ]
     
{ "1":[{ name:"1", status:"1" }, { name:"2", status:"1" }], "2":[{ name:"3", status:"2" }, { name:"4", status:"2" } ], "3":[ { name:"5", status:"3" }],"bbb":[{ name:"6", status:"bbb" }] }

use ES6 how to change the above into the following structure, cute new call for help. Is to propose status as the following key value.

Mar.11,2021

var result = {};
a.forEach(item => {
    result[item.status] = result[item.status] || [];
    result[item.status].push(item);
});

console.log(result)

you don't need a push, to filter each status directly

var b = {};
a.forEach(function (obj) {
    var array = b[obj['status']] || [];
    array.push(obj);
    b[obj['status']] = array;
});
console.log(b);
Menu