Which method returns a new array with all elements that pass the implemented test?

JavaScript Developer Easy

JavaScript Developer — Easy

Which method returns a new array with all elements that pass the implemented test?

Key points

  • filter() creates a new array with elements that pass a test.
  • map() creates a new array by transforming each element.
  • forEach() iterates over elements but does not return a new array.
  • reduce() reduces the array to a single value.

Ready to go further?

Related questions