We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5873fe commit 1a07fa7Copy full SHA for 1a07fa7
README.md
@@ -323,3 +323,25 @@ Object.isFrozen(obj) //true
323
```
324
325
326
+# Printing Object keys and values
327
+
328
329
+```javascript
330
+const obj = {
331
+ name: "JSsnippets",
332
+ age:29,
333
+};
334
335
+//Object.entries() method is used to return an array consisting of enumerable property
336
+//[key, value] pairs of the object which are passed as the parameter.
337
338
+for(let [key,value] of Object.entries(obj)){
339
+ console.log(`${key}: ${value}`)
340
+}
341
342
+//expected output:
343
+// "name: Jssnippets"
344
+// "age: 29"
345
+// order is not guaranteed
346
347
+```
0 commit comments