python一维数组求和_js 一维数组查询和数值相加
题主表意不明。如果是一维数组的话:var sum = function (input, uid) {return input.filter(function (i) { return i.uid === uid; }).reduce(function (f, s) { return f.num + s.num; });};sum([{"uid":"5744242bc4c971005d5ff04e"...