Mega Code Archive

 
Categories / JavaScript Tutorial / Operators
 

Using Bitwise Exclusive OR Plus Assignment Operator

< html>     <script language="JavaScript">     <!--     // integer = 32-bit binary representation     // 10 = 00000000000000000000000000001010     //  6 = 00000000000000000000000000000110     // 12 = 00000000000000000000000000001100     x = 10;     x ^= 6;     document.write("x = ",x);     -->     </script> </html>