What is Bitwise AND Operator (&) in JavaScript?

JavascriptWeb DevelopmentFront End Technology

It performs a Boolean AND operation on each bit of its integer arguments.

Example

You can try to run the following code to learn how to work with Bitwise AND Operator −

<html>
   <body>
      <script>
         var a = 2; // Bit presentation 10
         var b = 3; // Bit presentation 11

         document.write("(a & b) => ");
         result = (a & b);
         document.write(result);
      </script>
   </body>
</html>
raja
Published on 19-Jan-2018 10:15:22
Advertisements