Move the operator of the left move (<<)
Left shift expression position.
result = Expression1 << Expression2
parameter
result
Any variable.
Expression1
Any expression.
Expression2
Any expression.
illustrate
<< The number of bits specified by the exclusive position of Expression1 to the left is shifted to the left. For example:
var Temp
temp = 14 << 2
The value of the variable TEMP is 56, because 14 (that is, the binary 00001110) to the left to the left is equal to 56 (that is, the binary 0011000).
JavaScript converts the expression numbers into binary according to the position of the left -handed operator (<<), and then moves to the left to the left.
result = [Number to displacement] << [displacement number]
Rove the operator (<<) to the left to move the number of digits of [to the number of displacement] in the left. For example:
Copy code code as follows:
var test;
temp = 14 << 2;
/*
The binary of 14 is 00111000
00001110 shifted to the left position 2 position 00111000 = 56
*/
alert (temp);
// Poppy [56]