artdaq_node_server
v1_00_08
|
_.reduce([1, 2], function(sum, n) { return sum + n; }, 0); // => 3
_.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { (result[value] || (result[value] = [])).push(key); return result; }, {}); // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)