More Array Methods:
These further Array methods are listed separately as they need their own functions()
with or without arguments.
For this page, all functions()
use the following [arrays]
and functions()
, which have been declared globally:
membersDogsDAmour = ["Tyla", "Bam Bam", "Jo Dog", "Steve James"];
countUp = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
- Manipulating
[arrays]
array.every(function(currentValue, (index), (arr)), (thisValue));
Checks if all elements in an [array]
pass a test (function). Does not alter original [array]
array.filter(function(currentValue, (index), (arr)), (thisValue));
Checks if all elements in an [array]
pass a test (function). Filters those that do. Does not alter original [array]
array.some(function(currentValue, (index), (arr)), (thisValue));
Checks if all elements in an [array]
pass a test (function). Returns true if ONE passes the test. Does not alter original [array]
array.find(function(currentValue, (index), (arr)), (thisValue));
Checks if all elements in an [array]
pass a test (function). If found, returns the found item and then stops. Does not look for more. Does not alter original [array]
array.findIndex(function(currentValue, (index), (arr)), (thisValue));
Checks if all elements in an [array]
pass a test (function). If found, returns the found item's index and then stops. Does not look for more. Does not alter original [array]
array.reduce(function(currentValue, (index), (arr)), (thisValue));
Reduces all elements in an [array]
to one value. Returns that value. Does not alter original [array]
array.reduceRight(function(currentValue, (index), (arr)), (thisValue));
Reduces all elements in an [array]
to one value. Returns that value. Does not alter original [array]
array.map(function(currentValue, (index), (arr)), (thisValue));
Reduces all elements in an [array]
to one value. Returns that value. Does not alter original [array]