[javascript| basic concept |object] learning notes

Source: Internet
Author: User
Tags hasownproperty

Objects: Collections of data and features

Create object: New Object type name

e.g.: var o = new Object (); or var o = new Object (omitted (), not recommended) or var o = {} (Create object literal)--object instance

Each instance of the object type has any properties and methods saved by the object type:

Constructor: Holds the function that is used to create the current object, such as the constructor of the preceding O object instance is Object

hasOwnProperty (PropertyName): detects whether a given property exists in the current object instance (not in the instance's prototype), returns a Boolean value, and PropertyName specifies e.g as a string.: O.hasownproperty ("name")

isPrototypeOf (object): Detects if the incoming object is a prototype of another object, Object1.isprototypeof (OBJECT2), returns a Boolean value (Object2 's prototype chain contains Object1, Returns true if the OBJECT2 prototype chain does not contain Object1 or object2 is not an object and will return false)

propertyIsEnumerable (PropertyName): Used to detect whether a given property can be enumerated with a for-in statement, specified as a string

Tolocalstring (): Returns the string representation of an object that corresponds to the region of the execution environment

ToString (): Returns the string representation of an object

ValueOf (): Returns the object itself

[javascript| basic concept |object] learning notes

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.