Object.entries() - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

coerced to objects

Non-object arguments are coerced to objects. undefined and null cannot be coerced to objects and throw a TypeError upfront. Only strings may have own enumerable properties, while all other primitives return an empty arra

Using Object.entries() on primitives

Non-object arguments are coerced to objects. undefined and null cannot be coerced to objects and throw a TypeError upfront. Only strings may have own enumerable properties, while all other primitives return an empty arra

Using Object.entries() on primitives

Non-object arguments are coerced to objects. undefined and null cannot be coerced to objects and throw a TypeError upfront. Only strings may have own enumerable properties, while all other primitives return an empty arra

Using Object.entries() on primitives

Non-object arguments are coerced to objects. undefined and null cannot be coerced to objects and throw a TypeError upfront. Only strings may have own enumerable properties, while all other primitives return an empty arra

Converting an Object to a Map

The Map() constructor accepts an iterable of entries. With Object.entries, you can easily convert from Object to Map:

Converting an Object to a Map

The Map() constructor accepts an iterable of entries. With Object.entries, you can easily convert from Object to Map:

array destructuring

Using array destructuring, you can iterate through objects easily.

Enumerability and ownership of properties

Object.prototype.propertyIsEnumerable()

Object.fromEntries()

Object.getOwnPropertyNames()

Map.prototype.entries()

Learn how to contribute

This page was last modified on Jul 20, 2025 by MDN contributors.

defineProperties()

getOwnPropertyDescriptor()

getOwnPropertyDescriptors()