Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active September 13, 2024 21:41
Show Gist options
  • Select an option

  • Save wilmoore/9794bc20510ad19c265b957a1054be6c to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/9794bc20510ad19c265b957a1054be6c to your computer and use it in GitHub Desktop.
Software Engineering :: Programming :: Languages :: JavaScript :: Array :: Method :: Iterative

Software Engineering :: Programming :: Languages :: JavaScript :: Array :: Method :: Iterative

⪼ Made with 💜 by Polyglot.

related

JavaScript Array Iterative Methods

returns void

  • forEach(): no built-in ability to break. If you need this, use another iterative method or drop down to a for loop.

returns boolean

  • every(): might not see every element
  • some(): might not see every element

returns Array<Element>

  • filter()
  • flatMap()
  • map()

returns Item

  • find(): might not see every element
  • findLast(): might not see every element

returns Number

  • findIndex(): might not see every element
  • findLastIndex(): might not see every element

returns unknown

  • reduce(): does not accept thisArg
  • reduceRight(): does not accept thisArg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment