Which array method creates a new array with the results of calling a function on every element?

JavaScript Associate Easy

JavaScript Associate — Easy

Which array method creates a new array with the results of calling a function on every element?

Key points

  • map() creates a new array based on the results of a function applied to each element.
  • forEach() simply iterates over each element without creating a new array.
  • filter() creates a new array with elements that pass a certain condition.
  • reduce() reduces the array to a single value based on a function.

Ready to go further?

Related questions