about | help | code help+videos | done | prefs |
Write a method that adds all the even numbers in an array of integers and returns the result as an integer. The array may be empty, may contain only even numbers, may contain only odd numbers, or may contain a mixture of both. sumEvens([4, 3, 8, 7, 14, 5, 19, 18]) → 44 sumEvens([4, 6, 8, 2, 2, 0, -4, -8]) → 10 sumEvens([]) → 0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy