Answers for "javascript sum of arguments"

8

javascript sum of arguments

const sum = (...input) => {
  input.reduce((a, b) => a + b)
}

// Example
sum(1, 2, 3, 4)
//output
10
Posted by: Guest on June-21-2021
1

javascript sum of arguments

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

// Example
sum(1, 2, 3, 4); //10
Posted by: Guest on July-03-2020

Code answers related to "javascript sum of arguments"

Code answers related to "Javascript"

Browse Popular Code Answers by Language