Skip to content

Array methods

Array methods

  • .map(fn) makes a new array by transforming each item.
  • .filter(fn) makes a new array of only the items where fn returns true.
  • .forEach(fn) runs fn for each item, making no new array.

map transforms every item; filter keeps only the items that pass the test

Log in or create account

IGCSE & A-Level