LearnFrenzy
Sign in Take a free test

Array Methods · Exercise 1 of 4

Array Methods Array Methods MCQ

  • 15 questions
  • Page 2 of 2
  • Answers explained
0Attempted
0Correct
0Wrong
Directions

Fifteen multiple-choice questions on JavaScript array methods: map, filter, reduce, forEach, find and findIndex, findLast, some and every, flat and flatMap, callback arguments, sorting stability and which methods mutate. Pick an option to check your answer instantly.

Question 11 Medium

Which method changes the array it is called on?

A sort
B map
C filter
D flatMap
Question page & discussion
Question 12 Easy

In what order does map pass arguments to its callback?

A element, index, array
B index, element, array
C array, index, element
D element only
Question page & discussion
Question 13 Easy

In arr.reduce((acc, x) => acc + x, 0), what is acc on each call?

A The value returned by the previous call (0 on the first call)
B The current index
C The original array
D Always 0
Question page & discussion
Question 14 Medium

For const logs = [{ ok: true }, { ok: false, id: 1 }, { ok: false, id: 2 }];, what is logs.findLast((l) => !l.ok).id?

A 1
B 2
C undefined
D It throws
Question page & discussion
Question 15 Hard

Students are sorted by marks only. What happens to two students with equal marks?

A They keep their original relative order – sort is stable (since ES2019)
B Their order is random
C The later one always comes first
D One of them is removed
Question page & discussion
Up next · Exercise 2Predict the Output20 questions

Ready to test your Programming?

Timed online tests with instant scores and explanations.

Search LearnFrenzy

Esc

Quick links