Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript sum of arguments

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

// Example
sum(1, 2, 3, 4)
//output
10
 
PREVIOUS NEXT
Tagged: #javascript #sum #arguments
ADD COMMENT
Topic
Name
2+5 =