Given two integers a and b, find the sum of all the integers between and including them

PHOTO EMBED

Thu Oct 12 2023 14:23:02 GMT+0000 (Coordinated Universal Time)

Saved by @Paloma

function getSum(a, b){
    return (Math.max(a, b) - Math.min(a, b) + 1) * (Math.min(a, b) + Math.max(a, b)) / 2;
}
content_copyCOPY

https://www.codewars.com/kata/55f2b110f61eb01779000053/javascript