JavaScript array.some() Function

JavaScript Logo

array.some() – Checks whether **at least one** element passes the test implemented by the callback.

๐Ÿ‘‰ Syntax

bool = array.some((element, index, array) => {
  return /* true to stop loop */;
}, thisArg);

๐Ÿงช Example

const nums=[3,5,8];
console.log(nums.some(n => n > 6)); // true

Comments