What is Bitwise OR Assignment Operator (|=) in JavaScript?

JavascriptWeb DevelopmentFront End Technology

It performs OR operation on the right operand with the left operand and assigns the result to the left operand.


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

         var a = 2; // Bit presentation 10
         var b = 3; // Bit presentation 11

         document.write("(a |= b) => ");
         document.write(a |= b);
Published on 19-Jan-2018 10:36:45