Detailed description of javascript Object scalability, and javascript scalability
Scalability in javascript objects refers to whether new attributes can be added to objects. All built-in and custom objects can be displayed as extensible objects. For host objects, it is determined by the javascript engine.
The following functions are used to set object Scalability:
1. Object. isExtensible (Object); check whether the Object can be extended.
2. Object. preventExtensions (Object) sets that an Object cannot be expanded, that is, a new attribute cannot be added. However, if a new attribute is added to the prototype of the Object, the Object also inherits this attribute.
3. Object. seal (Object); in addition to setting the Object's non-expandable attributes, you can also set its own attributes to unconfigurable and cannot delete or configure the Object. You can still set its existing writable attributes.
4. Object. isSealed (Object); check whether the Object is closed.
5. Object. freeze (); more strictly lock the Object (freeze ). Except for setting the object to non-extensible, the attribute is set to non-configurable, and all its own attributes are set to read-only. (if the object storage attributes have the setter method, the memory attributes are not affected, you can still assign values to them through attributes ).
6. Check whether the Object is frozen by Object. isFrozen.