JS:数组根据某个属性值,将其他属性值相加

JS操作数组根据某个属性值,将其他属性值相加求和

var carbonData = [{
        CountyName: '瑶海区',
        CityName: '合肥市',
        ProvinceName: '安徽省',
        sequestration2010: 0.159123646,
        sequestration2011: 0.163177413,
        sequestration2012: 0.158292146,
        sequestration2013: 0.172154629,
        
    },
    {
        CountyName: '庐阳区',
        CityName: '合肥市',
        ProvinceName: '安徽省',
        sequestration2010: 0.171775238,
        sequestration2011: 0.170471173,
        sequestration2012: 0.16556312,
        sequestration2013: 0.186257874,
        
    },
    {
        CountyName: '蜀山区',
        CityName: '合肥市',
        ProvinceName: '安徽省',
        sequestration2010: 0.165791691,
        sequestration2011: 0.159910686,
        sequestration2012: 0.161602813,
        sequestration2013: 0.175492414,
        
    },
    {
        CountyName: '包河区',
  

你可能感兴趣的:(JavaScript,javascript)