🎙 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 3 of 10

What does this print? (code)

What does this print?

console.log([3, 4, 5].reduce((acc, n) => acc + n, 10));
  1. A.12
  2. B.22
  3. C.60
  4. D.345
Answer & explanation

Correct answer: 22

Starting from 10: 10 + 3 + 4 + 5 = 22.

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 →