JavaScript Array.prototype.some() Guide

JavaScript Logo

Array.prototype.some() – Returns **true** once *any* element makes the callback return truthy.

๐Ÿ‘‰ Syntax

const bool = array.some((element, index, array) => {
  return /* condition */;
}, thisArg);

๐Ÿงช Example

const nums=[2,4,7];
console.log(nums.some(n=>n%2!==0)); // true

Comments