---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Array.prototype.values()

The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array.

## Syntax

```js
values()
```

### Return value

A new iterable iterator object.

## Description

`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx).

```js
Array.prototype.values === Array.prototype[Symbol.iterator]; // true
```

When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`.

The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties.
