Array.sum()
Return the sum of all numbers of the array
Parameters
Name | Type | Description | |
---|---|---|---|
1 | array | number[] |
Return value
number
the result
Usage
import {NumArray} from '@lcluber/type6js';
let array = [1,2,3];
let sum = NumArray.sum(array);
console.log(sum); //6