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);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e2a7-2c3f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e2a7-2c3f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?