Underscore.js _.some() Method

Beginner
5 min read
Updated: Nov 2026
4 examples
Collection

Definition

Returns true if any of the values in the list pass the predicate truth test (official Underscore docs). Stable Collection helper — not deprecated. Alias: _.any.

Pass the required arguments shown below. Underscore collection helpers usually return a new value — check whether the source is mutated.

Syntax

Call _.some. Start with this line.

Underscore
_.some(list, [predicate], [context])
CallWhat it does
_.some(list, [predicate], [context])Primary signature.
_.some(...)Call with the arguments your case needs.

Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.

Library declarations
Underscore
_.some(list, [predicate], [context])

Parameters

ParameterDescription
listRequired. Collection to test
predicateOptional. Truth test (default: identity / truthy)
contextOptional. this binding for the predicate

Return Value

Return ValueDescription
*true or false

Underscore.js Examples

Example 1 — Official: Any Truthy Value

No predicate — check whether any value is truthy.

Underscore
_.some([null, 0, 'yes', false]);
// → true

_.any([null, 0, 'yes', false]);  // same (alias)
// → true
Try It Yourself

How It Works

  1. Default predicate is identity — “is this truthy?”
  2. null and 0 fail; 'yes' passes.
  3. Short-circuit — Underscore returns true immediately.
  4. _.any is identical — official alias.

Example 2 — Custom Predicate

Ask whether any number is even.

Underscore
_.some([1, 3, 5, 6], function (num) {
  return num % 2 === 0;
});
// → true   // 6 is even

_.some([1, 3, 5], function (num) {
  return num % 2 === 0;
});
// → false
Try It Yourself

How It Works

  1. Predicate receives each value (num).
  2. First list: odds fail; 6 passes → true.
  3. Second list: every value fails → false.
  4. Contrast: _.every would require every value to be even.

Example 3 — Object Matcher Shorthand

Pass a properties object instead of a function.

Underscore
var users = [
  { name: "Ada", active: false },
  { name: "Grace", active: true }
];

_.some(users, { active: true });
// → true
Try It Yourself

How It Works

  1. Iteratee shorthand: { active: true } becomes a matcher.
  2. Ada fails; Grace matches → true.
  3. Same idea as _.matcher({ active: true }).
  4. Need the object? Use _.find instead of a boolean.

Example 4 — Empty List & None Pass

Empty collections and total misses both return false.

Underscore
_.some([]);
// → false

_.some([null, 0, false, '']);
// → false   // all falsy; identity finds nothing
Try It Yourself

How It Works

  1. Empty list: no values to test → false.
  2. All falsy: identity never succeeds → false.
  3. Opposite of the official example (which had 'yes').
  4. Membership only? Prefer _.contains.

Browser & Runtime Support

_.some / _.any ship with Underscore.js (1.x). They run anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.

✓ Stable · Underscore 1.x

_.some()

Available in [email protected] (UMD / ESM). Alias _.any. Works in evergreen browsers and current Node LTS when Underscore is loaded.

100% With Underscore 1.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.some Underscore 1.x+

Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).

Frequently Asked Questions

_.some(list, [predicate], [context]) returns true if any value in the list passes the predicate. Official example: _.some([null, 0, 'yes', false]) → true (identity: at least one truthy value).
_.any is an alias of _.some — same function. Use whichever name your team prefers.
Yes. It short-circuits: as soon as one value passes, it stops and returns true.
_.some([]) returns false — there is no value that can pass the test.
_.some is true when at least one value passes (OR). _.every is true only when all values pass (AND).
Yes. With no predicate, Underscore uses identity — _.some checks whether any value is truthy.

Next: _.contains()

Check whether a specific value is present in a list.

_.contains() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful