CARVIEW |
Select Language
HTTP/2 307
date: Mon, 13 Oct 2025 08:05:14 GMT
content-type: text/html
content-length: 70
location: https://how.dev/answers/what-is-the-objectentries-method-in-javascript
cf-ray: 98dd54ad1e19c1a1-BLR
cache-control: public, max-age=300, stale-while-revalidate=604800
referrer-policy: strict-origin-when-cross-origin
x-app-version: v251008-h-251010-1202
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-app-type: Learn
x-robots-tag: all
x-nextjs-cache: MISS
x-cloud-trace-context: 8df90548f1bb26db2e830ae9944abe43
via: 1.1 google
alt-svc: h3=":443"; ma=86400
cf-cache-status: MISS
set-cookie: __cf_bm=pP80.a40MDSqNhi9qgc0K_3lk5voDMNlXqoP75giVWA-1760342714-1.0.1.1-zXNbw9mMdlhnjsySSEwdG_IEsDAE0g0Nxz2tF7qlXmw_OZOHITNXHzDMtWFSz2PNtrDOyre4nY5osy.v6fpb97DKNkEyvo8thBkxzfhEUDI; path=/; expires=Mon, 13-Oct-25 08:35:14 GMT; domain=.educative.io; HttpOnly; Secure; SameSite=None
vary: Accept-Encoding
strict-transport-security: max-age=31536000; includeSubDomains; preload
server: cloudflare
HTTP/2 200
cache-control: public, max-age=300, stale-while-revalidate=604800
referrer-policy: strict-origin-when-cross-origin
x-app-version: v251008-h-251010-1202
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-app-type: Learn
x-middleware-rewrite: /answers/howdev/what-is-the-objectentries-method-in-javascript
x-nextjs-cache: MISS
etag: W/"k5jbcp1nsq6hd5"
content-type: text/html; charset=utf-8
x-cloud-trace-context: 9279fc14aedfd7ea73af273c11ad5d54
date: Mon, 13 Oct 2025 08:05:15 GMT
server: Google Frontend
via: 1.1 google
vary: Accept-Encoding
content-encoding: gzip
x-cache-status: miss
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
What is the Object.entries() method in JavaScript?
What is the Object.entries() method in JavaScript?
The object.entries()
method returns an array of [key,value] pairs that contain all of the object’s properties. This array only includes the enumerable properties and does not include properties from the prototype chain.
Enumerable properties are properties created with simple assignment or with a property initializer.
The order of the properties is the same as that given by looping over the property values of the object manually.
Syntax
The function takes an object whose enumerable property (i.e.,[key, value] pair) is to be returned. It returns an array containing these properties.
Object.entries(obj)
Code
The following code demonstrates the use of the Javascript object.entries()
method.
// A map objectconst obj = { 'adam': 100, 'smith': 40, 'jon': 62 };// The object.entries method converts this map// object into array of propertiesconsole.log(Object.entries(obj));// Accessing the second property of this array.console.log(Object.entries(obj)[1]);
Relevant Answers
Explore Courses
Free Resources
Copyright ©2025 Educative, Inc. All rights reserved