function sum(arr) {
    return arr.reduce((pre, next) => pre + next);
}