🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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));
  1. A.[ 10, 30 ]
  2. B.[ 20, 40 ]
  3. C.[ 10, 20, 30, 40 ]
  4. 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 →