Favorites

JavaScript Object.fromEntries() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Object.fromEntries()
JavaScript Object Static methodThis method is supported by all modern browsers.
Updated 28th November 2026

The Object.fromEntries() static method builds an object from a list of [key, value] pairs, such as a Map or the result of Object.entries().

Description

The Object.fromEntries() static method is the reverse of Object.entries(): it turns an iterable of key-value pairs into an object. It converts a Map into a plain object, turns URLSearchParams or FormData into an object, and rebuilds an object after transforming its entries.

Each entry must be an object with a key at index 0 and a value at index 1, usually a two-element array; if the same key appears more than once, the last value wins. Keys are converted to strings, or kept as symbols.

Note that a URLSearchParams or FormData object with repeated keys, such as several checkboxes with the same name, only keeps the last value when converted this way. Use getAll() on the original object to read every value for a key.

Syntax

Object.fromEntries(iterable)

Parameters

  • iterableAn iterable of [key, value] pairs, such as an array of pairs or a Map.

Return Value

A new object built from the pairs.

Example

console.log(Object.fromEntries([['a', 1], ['b', 2]]));
console.log(Object.fromEntries(new Map([['x', true]])));

const prices = { tea: 3, cake: 5 };
console.log(Object.fromEntries(Object.entries(prices).map(([k, v]) => [k, v * 2])));
console.log(Object.fromEntries(new URLSearchParams('q=css&page=2')));

Browser Support

The following information will show you the current browser support for the Object.fromEntries() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee