Created
July 3, 2023 17:10
-
-
Save kironroy/818d64b70406edb1ae0c5a5b581e1548 to your computer and use it in GitHub Desktop.
Array Methods List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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