JavaScript Learning Notes (iii)

Source: Internet
Author: User

Fourth Chapter Study

Wai Wai : December 9 I. Basic types and reference typesThe ECMAScript variable may contain values for two different data types: the underlying type value and the reference type value. the underlying type value refers to a simple data segment; A reference type value refers to an object that consists of many values1. Copy variable valuesIf this is the method of copying the underlying type value: Create a new space in the heap memory and copy that value past2. Passing ParametersThe parameters of all functions are passed by valueaccess variables are both by value and by reference, but parameters can only be passed by value3. Detection typeusually with typeofYou don't want to know that a value is an object, but you want to know what type of object it is. Well, then use instanceof .(for example, to detect whether a variable person is an object or an array or a regexp type, this time cannot be used typeof or need to use instanceof)II. implementation environment and scope1. Each function has its own execution environment2, there is a scope chain is to let the internal environment orderly, linear access to the external environment. 3. How to extend the scope chainCatch block in a try-catch statementWith statement4. Features:(i) there is no block-level scope, so-called block-level scope to make an analogyif () {}In general curly braces If you define a variable, the scope of the variable is the curly brace, which is a block(ii) query identifiersLook in your local environment first, then follow the scope chain up, until you find it and stop looking.third, garbage collection1. Identify variables that are no longer in use and release the memory they occupy(i) Mark Clear(ii) Reference count

JavaScript Learning Notes (iii)

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.