Creating Objects ("JavaScript advanced Programming" mind mapping)

Source: Internet
Author: User

Object-oriented (object-oriented, OO) languages have a sign that they all have the concept of a class, and that a class can create any number of objects with the same properties and methods. There is no class concept in ECMAScript, so we can use objects to simulate the class. ECMA-262 defines an object as: "A collection of unordered attributes whose properties can contain basic values, objects, or functions." "Strictly speaking, this is equivalent to saying that the object is a set of values that do not have a particular order. Each property or method of an object has a name, and each name is mapped to a value.

Here are the methods of creating objects described in the JavaScript Advanced Programming program, which I have always formed in mind mapping mode:

The most widely used is the combination of the constructor pattern and the prototype pattern. In addition, the dynamic prototype pattern is also popular, functionally equivalent to the constructor mode/prototype mode. Either of these two approaches can be used. Do not use the classic constructor or prototype schema alone, however, because it introduces problems to your code.

Creating Objects ("JavaScript advanced Programming" mind mapping)

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.