The array methods for conditions are complex array methods that require the knowledge of how a function works and calling a function. If you are not familiar with that yet, we will be exploring function in-depth later in the course. The syntax and the function of the `every()`

method and the `some()`

method is shown below.

`arrayname.every(function)`

- Returns: boolean
- Returns true if ALL the elements of the array meets the criteria in the function
- Returns false if ANY of the elements does not meet the criteria in the function

`arrayname.some(function)`

- Returns: boolean
- Returns true if ANY of the elements of the array meets the criteria in the function
- Returns false if NONE of the elements meets the criteria in the function

The `every()`

and `some()`

method above checks each element against `isEvenNumber()`

and returns true or false depending on the number of elements that met the criteria. This is why the first `every()`

method returns false while the second one returns true. This is because odd numbers exits in `arr 1`

, meaning more than one element will return false after executing the function `isEvenNumber()`

. The `some()`

method will return true if some of the elements meet the criteria while the `every()`

method requires every element to meet the criteria.

Edit Me on GitHub!