Computes the sum of the sequence of number values that are obtained by invoking a transform function on each element.
Namespace: MindFusion.Common.Collections
File: IEnumerable.js
JavaScript Copy Code |
---|
function sum (selector) |
Type: function
function. A transform function to invoke on each element.
Type: Number
Number. The sum of the number values in the sequence.
The following code implements sum on a list with product instances:
JavaScript Copy Code |
---|
var product1 = new Object(); var product2 = new Object(); productList.addRange([product1, product2]);
|