Favorites

JavaScript Array.prototype.some() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Array.prototype.some()
JavaScript Array Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The some() method checks whether at least one element of an array passes a test, returning true or false.

Description

The some() method tests whether at least one element passes the callback's test. It stops and returns true as soon as it finds one, and returns false if none do (always false for an empty array).

It's ideal for checks like "is any item out of stock?". To check for an exact value, includes() is simpler.

Because it stops at the first match, some() is efficient for large arrays where a match is likely to be found early. Empty slots are skipped. Together with every(), it expresses "any" and "all" checks clearly; !arr.some(fn) means "none of the elements match".

Syntax

array.some(callbackFn)
array.some(callbackFn, thisArg)

Parameters

  • callbackFnA function called for each element, receiving element, index and array.
  • thisArgOptional. A value to use as this inside callbackFn.

Return Value

true if the callback returns a truthy value for at least one element, otherwise false.

Example

const cart = [{ name: 'Pen', stock: 4 }, { name: 'Ink', stock: 0 }];
console.log(cart.some(item => item.stock === 0));
console.log([1, 3, 5].some(n => n % 2 === 0));

Browser Support

The following information will show you the current browser support for the Array.prototype.some() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee