javascript sum of arguments
snippet in javascript

javascript sum of arguments

user5731

const sum = (...args) => args.reduce((a, b) => a + b);

// Example
sum(1, 2, 3, 4); //10