# \_.some（迭代断言函数，遇true停）

**语法：**

```javascript
_.some(collection, [predicate=_.identity])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L9892)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.some)

**描述：**

通过`predicate`（断言函数） 检查`collection`（集合）中的元素是否存在**任意**truthy（真值）的元素，一旦`predicate`（断言函数） 返回 truthy（真值），遍历就停止。 predicate 调用3个参数：*(value, index|key, collection)*。

**开始版本：**&#x30;.1.0

**参数：**

* `collection (Array|Object)`: 用来迭代的集合。
* `[predicate=_.identity] (Array|Function|Object|string)`: 每次迭代调用的函数。

**返回值：**

* `(boolean)`: 如果任意元素经 predicate 检查都为 truthy（真值），返回 true ，否则返回 false 。

**例子：**

```javascript
_.some([null, 0, 'yes', false], Boolean);
// => true

var users = [
  { 'user': 'barney', 'active': true },
  { 'user': 'fred',   'active': false }
];

// The `_.matches` iteratee shorthand.
_.some(users, { 'user': 'barney', 'active': false });
// => false

// The `_.matchesProperty` iteratee shorthand.
_.some(users, ['active', false]);
// => true

// The `_.property` iteratee shorthand.
_.some(users, 'active');
// => true
```


---

# Agent Instructions: 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://lodash.shujuwajue.com/collection/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.
