-
-
Save guilhermesilveira/061f46a82f5af9a09a59 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 soma(a,b) { | |
return a + b; | |
} | |
function maior(a,b) { | |
if(a > b) return a; | |
return b; | |
} | |
function somaPositivos(a) { | |
var total = 0; | |
for(var i = 0; i < a.length; i++) { | |
if(a[i] < 0) return -1; | |
total += a[i]; | |
} | |
return total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment