---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Object.fromEntries()

The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object.

## Syntax

```js
Object.fromEntries(iterable)
```

### Parameters

- `iterable`

  - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties:

    - `0`
      - : A string or `Symbol` representing the property key.
    - `1`
      - : The property value.

    Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value.

### Return value

A new object whose properties are given by the entries of the iterable.

## Description

The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key.

`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties.

> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type.
