JavaScript Advanced Programming 3rd Edition-study notes-2

Source: Internet
Author: User

P31-P82 page

1, equal unequal and congruent not equal

Equality is unequal: first converted and then compared. For only one object, call the ValueOf method to get the base type value and then convert it by the base type, and if all two are objects, compare whether they are the same object (reference or pointer value comparison), NULL is equal to undefined, and at least one is Nan equals false, Not equal to true;

Congruent not congruent: only comparison. Returns true only if the two operands are equal without conversion, and, in particular, null and undefined are not identical because the type of the connection is different

2. A function that does not specify a return value type returns a special value-undefined

3. Add properties only to reference types dynamically

1 New Object (); 2 obj.name = "Lisimi"; /* adding the Name property dynamically */

4, copy variables and pass parameters are value replication, value passing, for the basic data type, copy or pass is a copy of the value of the new variable, for reference data type, is also a value pass, but this value is special, is a reference value (or pointer), the reference point to the object is not involved in replication, That means the last two reference variables point to the same object

5. Each execution environment has a variable object associated with it, and all variables and functions defined in the environment are stored in the object. There are many kinds of execution environment, such as global environment, function environment, with environment, and so on, the variable objects of these environments form the scope chain together. The smaller the scope, the more the corresponding variable object is on the chain, the larger the scope, the more the variable object is on the chain, and the variable object of the global execution environment is always the last object in the scope chain.

6, there is no block-level scope, do not declare direct use is considered as a global variable (it is best not to write this).

7. The current JavaScript garbage collection mechanism uses the method of Mark clear

JavaScript Advanced Programming 3rd Edition-study notes-2

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.