Created
November 23, 2015 19:19
-
-
Save genert/efff854bd4614030b557 to your computer and use it in GitHub Desktop.
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
function findSum () { | |
var sum = 0; | |
arguments.__proto__ = Array.prototype; | |
for (val of arguments) { | |
if (val < 0) return -1; | |
sum += val; | |
} | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment