"JavaScript Advanced Programming" (third edition) Personal note

Source: Internet
Author: User

1. Using "Use strict" on the top of the script or in the first line of the function will enable strict mode or execute in strict mode
2. Define the variable that holds the object and initialize it to null
3.null = = Underfined,is true;
4.typeof Null,is object;
5.typeof is operator, not operand
6. When calculating, octal number (starting with 0, if written as 079, then decimal 79), and hexadecimal number (0x), will be converted to decimal
7.0.1 + 0.2 = = 0.3,is false; Do not test a specific floating-point value
8.isFinite (), judging whether it is between maximal and minimum; number.max_value,number.min_value,number.positive_infinity,number.negative_ INFINITY;
9.NaN = = Nan,is False;nan is not equal to any number;
10.Number (a), convert various data types to nan,0, decimal number, NULL returns 0,underfined return nan, "" returns 0;
11.parseInt (a), starting with the first numeric character or symbol, resolves to a non-numeric character (ignoring subsequent non-numeric characters), such as parseint ("12blue") returning 12,parseint (. 5) returns 0;parseint (". 5") Returns Nan;
12.parseInt (A, a); B is the cardinality; parseint (a,10) (always necessary to do so)
13.parseFloat () can only parse decimal digits, such as parsefloat ("0x9") return 0;parsefloat ("22.34.4") returns 22.34
14.js, 2.0 of the form will be resolved to 2;
"". Length calculates the number of characters in a string, and if the string contains double-byte characters, the number of characters returned may be inaccurate
16.null and undefined No. toString () method
17.num.tostring (b), B is the base, and if Num is 2, then num.tostring (2) returns 0010;
18.String (NULL) returns Null,string (underfined) returns underfined;
19. The self-increment or decrement of a string is converted to a numeric value and then self-increment or decrement. such as s= "Z", S++=nan; that is, non-numeric characters will first become NaN and then participate in the operation
20. Unary plus/minus operator, first converts the operand with number () to a number, and then becomes a positive or negative
21.~, negative value of operand minus 1
22. When you move to the right, the vacancy is filled with the symbol bit, and the negative number becomes larger when the unsigned right shifts >>>
23.nan/null/undefined participate in && operations, return to themselves; Engage with oneself | | The operation returns itself;
24.Infinity * 0 =nan,*-num=-infinity,*+num=infinity;
25.0/0=nan,2/0=infinity,-2/0=-infinity
26.0%num=0,num%infinity (-infinity) =num,infinity%num=nan,infinity%num=nan;
27.Infinity +-infinity = NaN
28. Uppercase letters are encoded less than lowercase
29.== conversion type in comparison, = = = does not convert (including comparison data type); Null==undefined is true;null===undefined is false;
30. It is recommended to use congruent and non-congruent in the code
31.var num=, num=3;
32.with statements (not available in strict mode, not recommended) set the scope of the code to a specific object
33.switch in comparison, the use is = = =; To deliberately merge multiple cases and write less break, add a comment
34.return; will return undefined
35.arguments.length gets the number of arguments passed in, Arguments[0] gets the first parameter value, the argument must be a value, cannot be a reference
36. Modify Arguments[0], will modify the NUM1 at the same time, the memory space is independent, but the value will be synchronized
37. Function is not signed, so it cannot be overloaded

"JavaScript Advanced Programming" (third edition) Personal note

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.