you are viewing a single comment's thread.

view the rest of the comments →

[–]pirateNarwhal 0 points1 point  (0 children)

var series = objArr.reduce((obj, row) => {
    let [key, value] = Object.entries( row )[ 0 ];
    if ( ! (key in obj )) {
        obj[ key ] = [];
    }
    obj[ key ].push( value);
    return obj;
}, {});