const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; const evenNumbers = numbers.filter(num => num % 2 === 0); console.log(evenNumbers); // [2, 4, 6, 8]
To embed this program on your website, copy the following code and paste it into your website's HTML: