An open API service indexing awesome lists of open source software.

https://github.com/jackhowa/sum-range

We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.
https://github.com/jackhowa/sum-range

algorithm array freecodecamp

Last synced: 9 months ago
JSON representation

We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.

Awesome Lists containing this project

README

          

# sum-range

We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.

The lowest number will not always come first.

## Tests

* sumAll([1, 4]) should return a number.
* sumAll([1, 4]) should return 10.
* sumAll([4, 1]) should return 10.
* sumAll([5, 10]) should return 45.
* sumAll([10, 5]) should return 45.