js general description of object-oriented

** ** JS Advanced outline
simple surface composition:
Properties ** two types of object, attribute data for a class, a class is accessed properties **
1, data attributes to store data.
2, accessor property is not used to save the data, but rather defines a get, set two functions, while reading attribute, automatically call get, when write access property, automatic call set.
** ** characteristic attribute
1, a single attribute xx.getOwnPropertyDescripeor ((object name)), (attribute name)) to obtain
2, with all attributes xx.getOwnPropertyDescripeors ((object name))) to obtain
characteristics:
Configurable: true / false operational attribute representing whether
enumerable: true / false is traversed whether it be for loop
value: attribute value is the original value of the
writable: true / false whether to modify the attribute value
attribute value of each object as insufficiency,
general there get in the constructor (), a representative may read, SET (), the representative may be modified
by modifying the original features Object.defineProperty or add new features.
Detecting whether the Extensible: Object.isExtensible (object name) ------ attribute is added
to detect whether the seal: Object.isSealed (object name) ----------- whether additions and deletions, can repair check
detecting whether frozen: Object.isFrozen (object name) ----------- additions and deletions can only check
Prohibit extensions: Object.preventExtensible (object name) ------ can not add attributes the
seal: Object.seal (object name) can not be added or deleted ------------------- can repair check
freeze: Object.freeze (object name) ----------------- additions and deletions can not only search

** Each constructor has a peototype (prototype) attribute value is an instance of the Object object, all the way ah ah properties of objects can be shared examples of his or inheritance **

Guess you like

Origin www.cnblogs.com/zhushuaiqi/p/11943532.html