JS Elevation Note 1-3 Chapter

Source: Internet
Author: User

The 1th Chapter JS Introduction

1.js consists of three parts, ECMAScript, DOM, BOM.

The 2nd chapter uses JS in HTML

1. Put the <script> tag in the end of the <body>, you can display the content of the page before loading the JS file, which is user-friendly.

The defer property of the 2.<script> tag indicates that the script is deferred until the page is parsed and executed, and async indicates that the table download script is loaded with HTML, equivalent to async.

Chapter 3rd Basic Concepts

1.js Everything is case-sensitive. The first digit of the identifier cannot be a number.

Five basic types of 2.js: undefined,null,boolean,number,string. A complex Type: object.

3.null is used to assign values to variables that are ready to be saved.

The 4.Boolean () function converts the value of any data type to a Boolean type. See P26

5. Any operation involving Nan is Nan,nan and Nan.

6. Bitwise operator: Bitwise NON (~), the negation code (the number of operands minus 1). Bitwise AND (&), the binary code is 1 returns 1. Bitwise OR (|), the binary code is 0 returns 0. Bitwise XOR (^), the binary code returns 0 as the same.

7. "+" for two strings is stitching, if one is not a string, it is converted into a string. "<" and other relational operators, if there is a number is a value, there is a not, then will not be converted to a numerical value.

8.null==undefined, but null===undefined returns false.

9. Parameters named in the function are not required and can be accessed using arguments[i]. You can use this to mimic overloading. P65

10. In the function, parameters that do not pass the value are automatically assigned to undefined.

JS Elevation Note 1-3 Chapter

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.