😍JavaScript Array some() method returns true (and stops) if the function returns true() (ok)
https://www.w3schools.com/jsref/jsref_some.asp
Example
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Arrays</h2>
<p>The Array.some() method checks if any of the elements in an array pass a test (provided as a function).</p>
<p id="demo"></p>
<script>
const ages = [3, 10, 18, 20];
const abc = ages.some((age) => {
console.log(age);
return age > 8;
});
console.log(abc);
</script>
</body>
</html>

PreviouslocaleCompare() method compares two strings return sort order -1, 1,0 (for before, after, or equal)NextAdd key value pair to all objects in array (ok)
Last updated
Was this helpful?