1. When a unary plus/minus operator is applied to a non-numeric value, the operator converts the value like the number () transformation function. Example: var s = + "01"//value becomes number 1.
All the values in 2.ECMAScript are stored in the IEEE-754 format, but the operators do not directly manipulate 64-bit values, so the whole process is like an integer that only has a four-bit value.
3. For signed integers, the first 31 bits in 32 bits are used to represent the value of an integer, the 32nd bit is the sign bit : 0 is a positive number, and 1 represents a negative. Where positive numbers are stored in a pure binary format, negative numbers are stored in twos-formatted complements.
4. Bitwise NON (~): The essence is the negative value of the operand minus one.
5. Shift Left (<<) does not affect the sign bit of the operand, right-shifted to the signed right shift (>>) and the unsigned Right shift (>>>).
6. Logical non (!) converts its operand to a Boolean value (simulates a Boolean ()) and then reverse.
7. In cases where an operand is not a Boolean value, the logical and (logical OR) operation does not necessarily return a Boolean value. A logical and (logical OR) operation is a short-circuit operation where the second operand is no longer evaluated if the first operand determines the result .
The additive and multiplicative operators in 8.ECMAScript perform automatic type conversions in cases where the operand is non-numeric.
9. Relational operators, if all two operands are strings, compare the character encoding values of the two strings.
10. Any operand compared to Nan, the result is false.
11.ECMAScript has two sets of equal operators: 1. equal and unequal (automatic conversion type after comparison); 2. congruent and non-congruent (non-conversion type direct comparison). Note: null and undefined are equal, but not congruent.
12.ECMAScript There is no block-level scope, so variables defined inside the code block can also be accessed externally.
13. You can use any data type in a switch statement, whether it is a string or an object, and the value of each case is not necessarily constant, it can be a variable, or it can even be an expression. The switch statement uses the strict equality operator when comparing values, so type conversions do not occur.
The function in 14.ECMAScript does not have to specify whether to return a value when it is defined.
The 15.return statement can have no return value, and the function returns undefined after it has stopped executing.
16. The parameter array can be accessed through the arguments object in the function body. Arguments[0] represents the first parameter, and so on. The length property of the arguments tells you how many arguments are passed to the function.
17.ECMAScript functions do not implement overloading in the traditional sense. If two functions with the same name are defined, the name belongs only to the post-defined function.
An important feature of the 17.ECMAScript function : named parameters are only convenient, but not necessary .
JavaScript Learning Note four: Basic Concepts (2)