Follow me to "JavaScript elevation 3" Third, course notes

Source: Internet
Author: User
Tags function definition

Follow me to "JavaScript elevation 3" Third Lecture: 4th Chapter
Course production: Bling, Xing elder brother, 5 years java,3 years front-end course Knowledge: JavaScript, Html, CSS course goal: The front-end system course, gradually go deep, find a front-end work Course Outline: The book directory Structure for the crowd: front-end beginners, can 0 basis, but to be serious, practical
Course Review
1. Data type: 5 basic types, 1 complex types. 2, Operator: need to pay attention to the operation of priority, the logic of the turn to tease. 3, statements: If-else, for, for-in, while4, functions: function definition, the two current methods

Add: Variables are referred to as global variables and local variables after the function is explained.

Several tips for the editor
1, quickly establish a variety of static projects required files: CSS, HTML, js2, static file template settings 3, HTML tags commonly used a shortcut key, just one.
Course Note 1, base type, and value of reference type
The basic types of variables are flexible, updating types at any time, but not recommended; complex types of variables that can be added and deleted at any time; the basic types of replication are value passing, not interfering with each other; replication of complex types is reference passing and interfering with each other. The parameter of the function, if it is the basic type, is the value pass, does not disturb the variable passed in; However, the complex type passes the reference, passing the address, like a pointer in the C language, modifies the properties of the original object. Another common operator for complex type detection is instanceof, which is more granular and harder to judge. Knowledge Point: When passing a complex type, be sure to pay attention to it.
2. Scope
Local variables: function internal global variables: external functions (easy to understand interpretation), usually stored under the Window object. There is no block-level action, only the inside of the function and outside the function. Variable queries, which are looked up from within, so the use of global variables takes into account efficiency issues.
3. Garbage collection
JavaScript automatically recycles, note a little, and try to remove the non-applicable global variables.
Homework after class
1, write the function, through the transmission of basic types and complex types, experience the difference between the two; imitate the book of the P71 program, 2, write functions, master global variables and local variables. Simulate the p73 and p74 page programs in the book.


Follow me to "JavaScript elevation 3" Third, course notes

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.