Skip to content

Commit ea75b60

Browse files
authored
Merge pull request #11 from svetley1/patch-1
* Example of non-enumerable fields
2 parents 7690045 + fa31c05 commit ea75b60

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

JavaScript/4-for-in-obj.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const hash = {
99

1010
hash.fifth = 2;
1111

12+
Object.defineProperty(hash, 'newField', {
13+
enumerable: false,
14+
value: 'valueOfNewField',
15+
});
16+
1217
for (const key in hash) {
1318
const value = hash[key];
1419
console.log(

0 commit comments

Comments
 (0)