JS's structure type understanding

Source: Internet
Author: User

In JS, we can see it through an OOP idea. Where function is the key word throughout the JS structure, using the function keyword to create a series of internal (that is, JS itself comes with the class), such as: object,array,string, etc., since the JS structure is clearly clear.

You can verify that the constructor, such as Object,array, are Function () {}.

Then in passing var a = new Object (), you can find that the constructor of a is object () {}; This is probably the JS schema.

We can also use the function to produce similar objects and arrays, such as the class, to achieve our own needs, and then with the JS comes with the class can do a variety of functions.

But there is one other thing: The object class is the ancestor class of the majority (whether it is all yet to be studied), and the primitive ancestor class of array is also the object class.

JS's structure type understanding

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.