Created
May 16, 2018 04:28
-
-
Save dverdin83/c34be3ff6bc80d1b4a499f2bf8aabdbf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sumAll(arr) { | |
| var sumAllInRange = 0; | |
| var array = arr; | |
| console.log(Math.min.apply(null, arr)); | |
| console.log(Math.max.apply(null, arr)); | |
| console.log(arr); | |
| for (i = Math.min.apply(null, arr); i <= Math.max.apply(null, arr); i++) { | |
| sumAllInRange += i; | |
| } | |
| console.log(sumAllInRange); | |
| return sumAllInRange; | |
| } | |
| sumAll([1, 4]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment