Thanks to visit codestin.com
Credit goes to www.tutorialspoint.com

JavaScript Bitwise XOR Operator



If both the bits are different, then 1 is returned when Bitwise OR (|) operator is used.

Example

You can try to run the following code to learn how to work with JavaScript Bitwise XOR Operator.

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("Bitwise XOR Operator<br>");

         // 7 = 00000000000000000000000000000111
         // 1 = 00000000000000000000000000000001
         document.write(7 ^ 1);
      </script>
   </body>
</html>
Updated on: 2020-05-20T10:50:12+05:30

242 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements