# Cypress Documentation
# Source: https://raw.githubusercontent.com/cypress-io/cypress-documentation/main/docs/api/utilities/lodash.mdx
# Path: docs/api/utilities/lodash.mdx

---
title: 'Cypress._ | Cypress Documentation'
description: Cypress automatically includes lodash and exposes it as Cypress._.
sidebar_label: Cypress._
slug: _
sidebar_position: 0
---

<ProductHeading product="app" />

# Cypress.\_

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

## Syntax

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

### Usage

<Icon name="check-circle" color="green" /> **Correct Usage**

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

<Icon name="exclamation-triangle" color="red" /> **Incorrect Usage**

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

## Examples

### `_.each`

```javascript
// 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`

```javascript
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](/app/references/bundled-libraries)