Use Shift Left Assignment operator in JavaScript
Description
The following code shows how to use Shift Left Assignment operator.
Example
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
<!--from w w w . j a v a 2 s . com-->
// 3 = 00000000000000000000000000000011
// 12 = 00000000000000000000000000001100
x = 3;
x <<= 2;
document.write("x = ",x);
</script>
</body>
</html>
The code above generates the following result.
Javascript Tutorial Bitwise
Use Bitwise Exclusive OR Operator in JavaSc...
Use Bitwise NOT (~) Operator in JavaScript
Use Compound Bitwise OR Assignment |= in Ja...
Use Shift Right Zero Fill Operator in JavaS...
Use Shift Right with Sign Assignment Operat...
Use Shift Right with Sign operator in JavaS...
Use the Bitwise AND Operator in JavaScript
Use the Bitwise AND Plus Assignment Operato...
Use the Bitwise Exclusive OR Operator in Ja...
Use the Compound Bitwise AND Operator in Ja...
Use the shift left operator in JavaScript
Using Bitwise Exclusive OR Assignment Opera...
Use Bitwise Exclusive OR Operator in JavaSc...
Use Bitwise NOT (~) Operator in JavaScript
Use Compound Bitwise OR Assignment |= in Ja...
Use Shift Left Assignment operator in JavaS...
Use Shift Right Zero Fill Assignment Operat...Use Shift Right Zero Fill Operator in JavaS...
Use Shift Right with Sign Assignment Operat...
Use Shift Right with Sign operator in JavaS...
Use the Bitwise AND Operator in JavaScript
Use the Bitwise AND Plus Assignment Operato...
Use the Bitwise Exclusive OR Operator in Ja...
Use the Compound Bitwise AND Operator in Ja...
Use the shift left operator in JavaScript
Using Bitwise Exclusive OR Assignment Opera...