Created
October 17, 2016 19:22
-
-
Save Viktorminator/8d94375baecc6b1ca7da6e1a12bfba53 to your computer and use it in GitHub Desktop.
Sum without highest and lowest number
This file contains 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
const sumArray = arr => ((arr == null) || (arr.length < 2)) ? 0 : arr.reduce((a, b) => a + b, 0) - Math.max(...arr) - Math.min(...arr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
best