CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

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

Topics

Filter and Square Evens

JavaScript quiz · Question 17
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);