liveBook · Manning

Any

An any or some operation returns a Boolean indicating whether at least one element in a collection satisfies a predicate or, when none is supplied, is truthy.

How 2 Manning books explain it

Secrets of the JavaScript Ninja, Second Edition

An Array method that returns true if at least one element passes a callback test.

How it is used
Tests whether at least one array item satisfies a callback condition.
How deep it goes
Defines the callback test with a concrete example, without detailing execution mechanics.
Examples
Checks whether any ninja object has a weapon property.
What you can do after
Apply JavaScript's Array some method to test whether any item meets a condition.

Read how Secrets of the JavaScript Ninja, Second Edition explains any →

Kotlin in Action, 2E

any is a Kotlin standard-library operation that returns true when at least one element in a collection satisfies a predicate.

How it is used
Checks whether at least one collection or sequence element satisfies a Boolean predicate.
How deep it goes
Explains predicate use, logical equivalents, sibling operations, and empty-collection behavior without descending into implementation internals.
Examples
Uses an age predicate over people, integer comparisons, negated all and any, and an empty list.
What you can do after
Apply it via the Kotlin standard library to express readable existence checks over collections and sequences.

Read how Kotlin in Action, 2E explains any →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.