Chapter 2 notes of the Javascript authoritative guide

Source: Internet
Author: User

1. property inheritance only occurs when the attribute is read, but does not occur when the attribute is written. If the P attribute of an object o is set, and O inherits the P attribute from its prototype, this occurs only when a new P attribute is directly created in O. However, O has its own P attribute, and it no longer inherits the P value from its prototype. When reading the value of P, JavaScript first looks at the properties of O. Since P is defined in O, it does not need to look up the prototype object, the P attribute value defined in the prototype is not found. We sometimes say that the property P of O is "hidden" or "hidden" the property P in the prototype.

2. Javascript supports a data type called an object, but JavaScript does not have a formal concept of classes. Javascript is a real object-oriented language because it uses prototype inheritance instead of class-based inheritance.

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.