Sums the elements in the given list. If you pass a list of numbers, it sums them directly. If you pass a list of objects, provide the key to sum.
sum([1, 2, 3]); // 6sum([{ x: 1 }, { x: 2 }], "x"); // 3 Copy
sum([1, 2, 3]); // 6sum([{ x: 1 }, { x: 2 }], "x"); // 3
Sums the elements in the given list. If you pass a list of numbers, it sums them directly. If you pass a list of objects, provide the key to sum.