JSFiddle - React, Tailwind, and code Playground

by dmitri_pavlutin

JavaScript

let countEven = 0;
const items = [1, 5, 100, 10];

items.forEach(function iterator(number) {
  if (number % 2 === 0) {
    countEven++;
  }
});

console.log(countEven); // => 2