Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Codewars JS Beginner Series #3 Sum of Numbers

const getSum = (a, b) => {
    let min = Math.min(a, b),
        max = Math.max(a, b);
    return (max - min + 1) * (min + max) / 2;
}
 
PREVIOUS NEXT
Tagged: #Codewars #JS #Beginner #Series #Sum #Numbers
ADD COMMENT
Topic
Name
1+8 =