Created
April 19, 2017 16:52
-
-
Save elc49/8cbdec037c17d5c7942591171c8c92cd 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 sum_even(a){ | |
var sum = 0; | |
for (var i = 0; i < a.length; i++){ | |
if(a[i] % 2 === 0){ | |
sum += a[i]; | |
} | |
} | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks good with me!