Arrays
Chester Wyke August 19, 2022 Updated: April 15, 2025 #javascriptSource: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
includes
Source: https://www.w3schools.com/jsref/jsref_includes_array.asp
Checks if the input is contained in the array
;
"Mango"; // Returns true
some
The some()
method tests whether at least one element in the array passes the test implemented by the provided
function.
It returns true if, in the array, it finds an element for which the provided function returns true;
otherwise it returns false.
It doesn’t modify the array.
;
// checks whether an element is even
;
even;
// expected output: true