PV
Size: a a a
СЧ
.card-success:not(.card-outline) > .card-header
M
M
M
M
.card-success:not(.card-outline) > .card-header
СЧ
СЧ
DT
const srcArr = [
{ id: 1, time: 1579111185330, rpm: 0, speed: 0, other: 'test1' },
{ id: 2, time: 1579111186340, rpm: 1, speed: 2, other: 'test2' },
{ id: 3, time: 1579111187340, rpm: 2, speed: 4, other: 'test3' },
];
const excludeKeys = ['id', 'other'];
const result = srcArr.reduce(
(acc, obj) =>
Object.entries(obj)
.filter(e => !excludeKeys.includes(e[0]))
.reduce(
(a, [key, val]) => ({
...a,
[key]: a[key] ? [...a[key], val] : [val],
}),
acc,
),
{},
);
console.log(Object.entries(result).map(([title, data]) => ({ title, data })));
IP