src/operator/group-by-function.js
function sum (arr) {
    if (isArray(arr) && !(arr[0] instanceof Array)) {
        const filteredNumber = getFilteredValues(arr);
        const totalSum = filteredNumber.length ?
                            filteredNumber.reduce((acc, curr) => acc + curr, 0)
                            : InvalidAwareTypes.NULL;
        return totalSum;
    }
    return InvalidAwareTypes.NULL;
}
function sum (arr) {
    if (isArray(arr) && !(arr[0] instanceof Array)) {
        const filteredNumber = getFilteredValues(arr);
        const totalSum = filteredNumber.length ?
                            filteredNumber.reduce((acc, curr) => acc + curr, 0)
                            : InvalidAwareTypes.NULL;
        return totalSum;
    }
    return InvalidAwareTypes.NULL;
}
function sum ( arr ) { if ( isArray ( arr ) && ! ( arr [ 0 ] instanceof Array ) ) { const filteredNumber = getFilteredValues ( arr ) ; const totalSum = filteredNumber . length ? filteredNumber . reduce ( ( acc , curr ) => acc + curr , 0 ) : InvalidAwareTypes . NULL ; return totalSum ; } return InvalidAwareTypes . NULL ; }
Reducer function that returns the sum of all the values.

@public
@param  {Array.<number>} arr - The input array.
@return {number} Returns the sum of the array.
Reducer function that returns the sum of all the values .