JavaScript Object Objects

Source: Internet
Author: User

Object objects are of little use to themselves, but they should be understood before other classes are known. Because object objects in ECMAScript are similar to Java.lang.Object in Java, all objects in the ECMAScript are inherited by this object, and all properties and methods in object objects appear in other objects, so the Ob is understood Ject objects, you can better understand other objects.

Object objects have the following properties:
Constructor
A reference (pointer) to the function that created the object. For object objects, the pointer points to the original object () function.
Prototype
a reference to the object's prototype of the object. For all objects, it returns an instance of object by default.
Object objects also have several methods:
hasOwnProperty (property)
Determines whether an object has a specific property. This property must be specified with a string. (For example, O.hasownproperty ("name"))
isPrototypeOf (object)
Determines whether the object is a prototype of another object.
propertyIsEnumerable
Determines whether a given property can be enumerated with a for...in statement.
ToString ()
Returns the original string representation of the object. For object objects, ECMA-262 does not define this value, so different ECMAScript implementations have different values.
ValueOf ()
returns the original value that best fits the object. For many objects, the method returns the same value as the return value of ToString ().

Note: Each of the properties and methods listed above will be overwritten by other objects.

JavaScript Object Objects

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.