Preview:
let arr = [1, 2, 3, 4, 5];

for (const [i, element] of arr.entries()) {
    if (element % 2 == 0) {
        console.log(`The ${element} is even and the position is ${i}`);
    }
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter