liveBook · Manning

Any

Also called some

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 3 Manning books explain it

Secrets of the JavaScript Ninja, Third Edition

A JavaScript method that returns true if at least one array element satisfies a predicate.

How it is used
Tests whether at least one array item satisfies a callback-defined condition.
How deep it goes
Demonstrates a property-check callback alongside `every`, without detailing edge cases or callback invocation rules.
Examples
Checks whether any object in an array has a `weapon` property.
What you can do after
Apply it via JavaScript's `some` method to answer whether any array item meets a specified condition.

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

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 →

Also covered in

What to know first

Related concepts

Questions about any

What is 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.

Which Manning books explain any?

Secrets of the JavaScript Ninja, Third Edition, Secrets of the JavaScript Ninja, Second Edition and Kotlin in Action, 2E.

What should I know before learning any?

Manning books that teach any usually introduce boolean, collection, Map and conversational ai first.

What is the difference between any and all?

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. An all operation returns a Boolean indicating whether every element satisfies a predicate or, when no predicate is given, is truthy.

What kinds of any are there?

Kinds of any include integer.

What is any part of?

Any is part of JavaScript. JavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.

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.