var arr1 = [
{name: "萧何", key: "屌丝", value: 52},
{name: "萧何", key: "屌丝", value: 22},
{name: "张良", key: "高富帅", value: 52},
{name: "韩信", key: "纯屌丝", value: 66},
{name: "韩信", key: "纯屌丝", value: 61},
{name: "刘邦", key: "屌丝", value: 55},
...
];
//结果
var arr2 = [
{name: "萧何", key: "屌丝", value: 74},
{name: "张良", key: "高富帅", value: 52},
{name: "韩信", key: "纯屌丝", value: 127},
{name: "刘邦", key: "屌丝", value: 55},
...
]