Count even numbers
function CountEvenNumbers(array) { var counter = 0; for (var i = 0; i < array.length; i++) { if (array[i] % 2 != 0){ break; } counter++ }; return counter; }