This article mainly describes the JavaScript bitwise LEFT operator (<<) to convert the expression number to binary, and then left the expression of the bit of the relevant information, the need for friends can refer to the
The bitwise Left operator (<<) shifts the bit of the expression to the left. result = expression1 << expression2 parameter result any variable. Expression1 of any expression. Expression2 of any expression. The description << operator shifts all bits of expression1 to the left expression2 the specified number of digits. For example, the value of temp temp = << 2 variable is 56, because 14 (that is, binary 00001110) shifts to the left two digits to 56 (that is, binary 00111000). The Javascript bitwise Left operator (<<) converts an expression number to binary, and then shifts the bits of the expression to the left. result = "number to be shifted" << "displacement digit" bitwise Left operator (<<) shifts the bit of "number to be shifted" to the left of the number of digits specified in "offset digits". For example: The code is as follows: Var temp; temp = << 2; /* 14 binary is 00111000 00001110 left-shift 2-bit 00111000 = +/alert (temp); Pop-up "56"