---
id: api/utilities/lodash
title: Cypress._
description: Cypress automatically includes lodash and exposes it as Cypress._.
section: api
source_path: docs/api/utilities/lodash.mdx
version: 4df0c75e373515c33269176d556219950487e085
updated_at: '2026-08-22T19:13:35.211Z'
---
# Cypress.\_

Cypress automatically includes [lodash](https://lodash.com/) and exposes it as `Cypress._`. Call any valid Lodash method on `Cypress._`

## Syntax

```
Cypress._.method()
```

### Usage

**Correct Usage**

```
Cypress._.keys(obj)
```

**Incorrect Usage**

```
cy._.keys(obj) // Errors, cannot be chained off 'cy'
```

## Examples

### `_.each`

```
// set local reference to lodash and jquery
const { _, $ } = Cypress

cy.get('li').then(($li) => {
  // use the _.each function
  _.each($li.get(), (el, i) => {
    // use $(...) to wrap the DOM element
    // into a jQuery object
    expect($(el).parent()).to.match('ul')
  })
})
```

### `_.chain`

```
cy
  // use the _.chain, _.map, _.take, and _.value functions
  .request('http://jsonplaceholder.typicode.com/users')
  .then((response) => {
    const ids = Cypress._.chain(response.body).map('id').take(3).value()

    expect(ids).to.deep.eq([1, 2, 3])
  })
```

## See also

*   [Bundled Libraries](/llm/markdown/app/references/bundled-libraries.md)
