LearnFrenzy
Sign in Take a free test

Array Methods · Array Methods MCQ · Question 11

Which method changes the array? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 11 Back to Exercise

Which method changes the array it is called on?

  • A sort Correct
  • B map
  • C filter
  • D flatMap
Correct Answer: Option A

sort works in place and returns the same array. map, filter and flatMap return new arrays. Use toSorted for a sorted copy.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links