Skip to content

Instantly share code, notes, and snippets.

@kironroy
Created July 3, 2023 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kironroy/818d64b70406edb1ae0c5a5b581e1548 to your computer and use it in GitHub Desktop.
Save kironroy/818d64b70406edb1ae0c5a5b581e1548 to your computer and use it in GitHub Desktop.
Array Methods List
// what do i want from this method?
// mutate an array, create a new array
// array includes
// array transform
// methods that MUTATE original array
// + add to original: .push, ,.unshift (start)
// - remove from original: .pop (end), .shift, .splice
// others: .reverse, .sort, .fill
// methods that create NEW ARRAY
// .map loop array
// .filter
// .slice (portion of original)
// .concat (add to original)
// .flat (flattening original)
// .flatMap
// An array index
// based on value .indexOf
// based on test condition .findIndex
// array element .find
// know if array includes
// .includes
// .some
// .every
// new string
// .join
// transform to value
// .reduce
// loop array
// .forEach // do some work, not produce new value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment