In JavaScript, the object consists of 3 attributes, namely, extensibility, class identifier, and attributes.
If the object's extensibility is false, the property cannot be added dynamically for the object. The object contains a property that is divided into accessors and values. Access attribute {get R () {/* function implementation */},set R () {/* Function implementation */}} Accessor property cannot save the value itself, set is equivalent to making changes to other properties in the object. The value of other properties can also be returned in get. The attribute value of the property is writable, configurable, value, enumerable. Accessor properties Use the Get,set property to replace both writable and value. In a browser that does not implement ES5, use __lookupgetter____lookupsetter__, the first parameter of the method is the property name, and the second parameter is function to view the get The Set property uses the __lookupgetter__ (' x ') __ parameter as the property name through Object.getownpropertydescriptor (object, property name), Object.defineproperty Use this method to add an attribute, you can configure the attribute value. If the property already exists, modify the attribute value. Object.defineproperties define multiple properties (object, {property name: {attribute value}}) Once the configuration is modified to false, you cannot modify the configuration again. The rest of the features are modified with the rule configurable to false, and writable rows can have true modified to false. The rest of the basic is immutable. the object. isPrototypeOf (a) Specifies whether an object has a on its prototype chain, and instanceof works like an object. propertyIsEnumerable (attributes) Whether the property is an enumerable object. hasOwnProperty (property) property is a property of its own in the keyword can detect whether an object and its prototype chain has a property var declared variable can not be deleted with the delete can be configured to false properties can also not
Properties in JavaScript objects (writable, configurable, enumerable, Value,getter,setter)