JavaScript Object Property Descriptors

Steve Griffith - Prof3ssorSt3v3
Steve Griffith - Prof3ssorSt3v3
15.6 هزار بار بازدید - 7 سال پیش - When you create an Object
When you create an Object and add properties there are actually six property descriptors that you can use to define qualities of the property that you have added.
DATA property descriptors are
value
writable
configurable
enumerable
ACCESSOR property descriptors are
configurable
enumerable
get
set

You can use these property descriptors in combination with a collection of Object methods to fine tune access to your properties and their value.

See the comments in the Code Gist for a list of all the property descriptors and the Object methods.

Code GIST: https://gist.github.com/prof3ssorSt3v...
7 سال پیش در تاریخ 1396/07/19 منتشر شده است.
15,673 بـار بازدید شده
... بیشتر