CJCoding With Joseph
15per day
← Back to Question List

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics:
JavaScript Quiz #17

Filter and Square Evens

mediumLoops

What output results from this code?

📄 Code

1const nums = [1, 2, 3, 4, 5, 6, 7, 8];
2const squaredEvens = nums
3 .filter(n => n % 2 === 0)
4 .map(n => n * n);
5console.log(squaredEvens);