var cars = [{
make: "audi",
model: "r8",
year: "2012"
},
{
make: "audi",
model: "rs5",
year: "2013"
},
{
make: "ford",
model: "mustang",
year: "2012"
},
{
make: "ford",
model: "fusion",
year: "2015"
},
{
make: "kia",
model: "optima",
year: "2012"
}];
var group = cars.reduce((r, a) => {
console.log("a", a);
console.log('r', r);
r[a.make] = [...r[a.make] || [], a];
return r;
}, {});
I want to make it a group of an array but This code doesn't work in IE so can anyone help me out to make it work in IE browser.(我想使其成为一组数组,但是此代码在IE中不起作用,因此任何人都可以帮助我使其在IE浏览器中起作用。)
ask by Dinesh ghimire translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…