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

The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that
contains the values for each element in the `Set` object in insertion order.

> **Note:** The **`keys()`** method is an alias
> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the
> `keys()` page redirecting here. It behaves exactly the same and returns
> **values** of `Set` elements.

## Syntax

```js
values()
```

### Return value

A new iterator object containing the values for each element in the given
`Set`, in insertion order.
