Professional Documents
Culture Documents
You have already learned about JavaScript object in the JavaScript Basics section.
Here, you will learn about object in detail.
As you know, object in JavaScript can be created using object literal, object
constructor or constructor function. Object includes properties. Each property can
either be assigned a literal value or a function.
Consider the following example of objects created using object literal and
constructor function.
Property Descriptor
In JavaScript, each property of an object has property descriptor which describes
the nature of a property. Property descriptor for a particular object's property
can be retrieved using Object.getOwnPropertyDescriptor() method.
As you can see in the above output, the property descriptor includes the following
4 important attributes.