Skip to content

Commit 6e5739c

Browse files
Vlad EsinDzyubSpirit
andauthored
Example of inherited fields (for...in obj) (#13)
Co-authored-by: Vlad <Dzyubavlad@gmail.com>
1 parent 8187ed4 commit 6e5739c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

JavaScript/4-for-in-obj.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Object.defineProperty(hash, 'newField', {
1414
value: 'valueOfNewField',
1515
});
1616

17+
Object.prototype.inheritedProperty = 'inherited';
18+
1719
for (const key in hash) {
1820
const value = hash[key];
1921
console.log(

0 commit comments

Comments
 (0)