The object of JavaScript

Source: Internet
Author: User

First, the constructor function

New Object ()

New Object (value) value: Can be a number, Boolean, or string, and these values will be converted to numbers, Boolean, or String objects.

Second, the attribute

Object.constructor the constructor property of all objects points to the function of the constructor of the current object.

            var arr = new Array (1, 2, 3);            document.write (arr.constructor);    function Array () {[native code]}            document.write (arr.constructor = = array);   True

Third, the method

1, hasOwnProperty () checks whether the object has a property that specifies the local definition of the name (not the inheritance).

2, isprototypeof () checks that the current object is not the type of the specified object.

3, propertyisenumerable () checks if the property of the specified name exists and can be enumerated with for/in.

4, toLocaleString () returns a localized string representation of the object.

5, ToString () returns a string representation of the object.

6, ValueOf () returns the original value of the current object.

Iv. static methods

1. Object.create () Creates a new object with only the specified prototypes and attributes.

2, Object.defineproperties () creates or configures one or more properties of the specified object.

3, Object.defineproperty () creates or configures a property of the specified object.

4, Object.freeze () sets the specified object to be immutable.

5, Object.getownpropertydescriptor () queries the attributes of the specified property of the specified object.

6, Object.getownpropertynames () returns an array containing all the non-inherited property names of the specified object.

7, Object.getprototypeof () returns the prototype of the specified object.

8, object.isextensible () checks whether the current object can be added to the new property.

9, Object.isfrozen () checks whether the current object is frozen.

10, object.issealed () checks whether the specified object is closed.

11, Object.keys () returns an array containing all the non-inheritable enumerable property names of the specified object.

12, Object.preventextensions () prevents new properties from being added to the specified object.

13, Object.seal () prevents you from adding new properties to the specified object or deleting existing properties.

The object of JavaScript

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.