var arr = [{"code":"111","num":1},{"code":"112","num":1},{"code":"111","num":3},{"code":"113","num":1},{"code":"113","num":5},{"code":"111","num":1}]
//像这样的一个数组,比较对象code,如果相等,取其num相加的值输出。
相关分类