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.
- Host: GitHub
- URL: https://github.com/jackhowa/sum-range
- Owner: JackHowa
- Created: 2017-08-23T21:20:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-23T21:47:20.000Z (over 8 years ago)
- Last Synced: 2025-01-21T16:44:22.258Z (11 months ago)
- Topics: algorithm, array, freecodecamp
- Language: JavaScript
- Homepage: https://www.freecodecamp.org/challenges/diff-two-arrays
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.