all
Test that each element of the array passes the given test.
[2,4,6].all((thisElement) => thisElement % 2 == 0); // true
[2,4,7].all((thisElement) => thisElement % 2 == 0); // false
Syntax
all(callback)
Returns
A boolean indicating whether all elements pass the test.
Notes
- The callback is expected to contain ONE parameter.