I used the below after reading about Arithmetic Progression. Interested in anyone’s thoughts. It ignores the use of any array related work and just sticks to the math aspect of the question.
function sumAll (arr) {
const min = Math.min(...arr);
const max = Math.max(...arr);
return (((max - min + 1) * (min + max)) / (2));
}