https://github.com/imelgrat/object-properties-enumerability
Object properties enumerability - defineProperty() and defineProperties() methods
https://github.com/imelgrat/object-properties-enumerability
enumerable enumeration iteration javascript object-property objects property-descriptor
Last synced: 9 months ago
JSON representation
Object properties enumerability - defineProperty() and defineProperties() methods
- Host: GitHub
- URL: https://github.com/imelgrat/object-properties-enumerability
- Owner: imelgrat
- Created: 2020-03-31T21:56:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-07T01:22:56.000Z (about 6 years ago)
- Last Synced: 2025-03-14T03:45:08.678Z (over 1 year ago)
- Topics: enumerable, enumeration, iteration, javascript, object-property, objects, property-descriptor
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Object properties enumerability
ECMAScript 5 introduced a new mechanism for managing and configuring what can be done to an object's properties. New **.defineProperty()** and **.defineProperties()** methods were implemented. These methods let you control the behavior of each property.
As you can most certainly guess, they define new object properties, just like the dot-notation property definition with one big difference: these methods let you control the behavior of each property.
By "behavior" I mean the ability to change the value of the property after it's been created (_writable_), the ability to control the available features of the property once defined (_configurable_). Last, but most relevant to this article, ES5 added the ability to determine whether the property will be _enumerable_ (shown in the `for..in` loop).
Read more at: https://imelgrat.me/javascript/object-properties-iteration-in-javascript/