This function calculates the sum of all numbers in array
. If the expressions
is supplied,
it is evaluated once for each element in array
and then the sum of these values is returned.
Note: this function is used to augment the Array
type in angular expressions. See
angular.Array
for more info.
angular.Array.sum(array[, expression]);
array – {Array} –
The source array.
expression(optional) – {(string|function())} –
Angular expression or a function to be evaluated for each
element in array
. The array element becomes the this
during the evaluation.
{number}
– Sum of items in the array.