Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript sum of arguments

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

// Example
sum(1, 2, 3, 4); //10
Source by 1loc.dev #
 
PREVIOUS NEXT
Tagged: #javascript #sum #arguments
ADD COMMENT
Topic
Name
5+2 =