mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2025-01-03 16:22:39 +00:00
11 lines
179 B
JavaScript
11 lines
179 B
JavaScript
|
var even = function (arr) {
|
||
|
var count;
|
||
|
for (var i = 0; i < arr.length; i++) {
|
||
|
if (arr[i]%2 == 0) {
|
||
|
count ++;
|
||
|
}
|
||
|
}
|
||
|
return even;
|
||
|
}
|
||
|
|
||
|
console.log(even([1,2,3,4,5,6,7,8,9]));
|