VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-object-fromentries-method/

⇱ JavaScript Object fromEntries() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Object fromEntries() Method

Last Updated : 12 Jul, 2025

The Object.fromEntries() method in JavaScript is a standard built-in object which is used to transform a list of key-value pairs into an object. This method returns a new object whose properties are given by the entries of the iterable.

Syntax:

Object.fromEntries( iterable )

Parameters: This method accepts a single parameter iterable which holds an iterable such as Array or Map or other objects implementing the iterable protocol. 

Return value: This method always returns a new object whose properties are given by the entries of the iterable. 

The below examples illustrate the Object.fromEntries() method in JavaScript: 

Example 1: In this example, we will convert a Map into an Object using the Object.fromEntries() method in JavaScript. 

Output:

Object { 1: 0, big: "small" }
Object { Geek1: "Intern", stipend: "Works basis" }

Example 2: In this example, we will convert an Array into an Object using the Object.fromEntries() method in JavaScript. 

Output:

Object { 1: 0, big: "small", a: "z" }
Object { Geek1: "Intern", stipend: "Works basis" }

Example 3: In this example, we will see some other Conversions to objects using Object.fromEntries() method in JavaScript.

Output:

Object { type: "Get_the Value", geekno: "34", paid: "10" }
Object { val1: 336, val2: 1035, val3: 228 }

We have a complete list of Javascript Object methods, to check those please go through this JavaScript Object Complete Reference article.

Supported Browsers: The browsers supported by Object.fromEntries() method are listed below:

  • Google Chrome 73 and above
  • Firefox 63 and above
  • Opera 60 and above
  • Safari 12.1 and above
  • Edge 79 and above
Comment