← Quiz: Functions, Arrays and Objects: all 10 questions
Quiz: Functions, Arrays and Objects · Question 1 of 10
What does this print? (code)
What does this print?
console.log([1, 2, 3, 4].filter((n) => n % 2 === 0).map((n) => n * 10));
- A.[ 10, 30 ]
- B.[ 20, 40 ]
- C.[ 10, 20, 30, 40 ]
- D.[ 2, 4 ]
Answer & explanation
Correct answer: [ 20, 40 ]
Keep even numbers (2, 4), then multiply each by 10.
Can you get the rest right without peeking?
Take the timed Quiz: Functions, Arrays and Objects quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →