> For the complete documentation index, see [llms.txt](https://conductor.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://conductor.js.org/api-reference/some.md).

# some

```erlang
some :: (Function predicate, Collection collection) => Boolean|Promise<Boolean> output
```

## description

Returns a `Boolean` indicating if at least one item in the input `collection` satisfies the provided `predicate` function. It works exactly like [`Array.prototype.some`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some), except it also accepts `Sets`, `Maps` & `Objects` as inputs, and *asynchronous* predicates.

{% hint style="info" %}
Like all functions in **conductor**, this function is automatically is curried. If the predicate is asynchronous, it will return a `Promise`, allowing you to use `Promise.prototype.then` or the `await` keyword to retrieve the result.
{% endhint %}

## examples

### basic example

```javascript
import { some } from 'conductor'

const numbers = [3, 1, 4]
const isEven = number => number % 2 === 0

some(isEven, numbers) // true
```

Here, we simply check if at least one item in our numbers array is an even number. Luckily, that's the case.

### using other data structures

```javascript
import { some } from 'conductor'

const object = { three: 3, one: 1, four: 4}
const set = new Set([3, 1, 4])
const map = new Map([['three', 3], ['one', 1], ['four', 4]])
const isEven = number => number % 2 === 0

some(isEven, object) // true
some(isEven, set) // true
some(isEven, map) // true
```

`some` also works on `Objects`, `Sets`, and `Maps`.

### using an asynchronous predicate

```javascript
import { some } from 'conductor'

const numbers = [3, 1, 4]
const isEvenAsync = async number => number % 2 === 0

await some(isEvenAsync, numbers) // true
```

Here, our predicate is asynchronous (notice the `async` keyword before the function definition), which makes some return a `Promise`. We then (no pun intended) simply use the `await` keyword to retrieve the result.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://conductor.js.org/api-reference/some.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
