Without a return the callback gives undefined, which is falsy.
Acceptance criteria
- 1.#out should show 2,4.
Without a return the callback gives undefined, which is falsy.
const numbers = [1, 2, 3, 4]; const evens = numbers.filter(n => { n % 2 === 0; }); document.querySelector('#out').textContent = evens.length === 0 ? "nothing kept" : evens.join(",");
Output ready when you are
Press Run to render your code, or Submit to validate your solution.