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: about 2 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 (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-23T21:47:20.000Z (almost 9 years ago)
- Last Synced: 2026-01-01T21:50:04.248Z (6 months ago)
- Topics: algorithm, array, freecodecamp
- Language: JavaScript
- Homepage: https://www.freecodecamp.org/challenges/diff-two-arrays
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- 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.