What is JavaScript Bitwise NOT(~) Operator?

HTMLJavascriptProgramming Scripts

The Bitwise NOT (~) Operator performs NOT operation on the bits. You can try to run the following code to learn how to work with JavaScript Bitwise NOT Operator.

Example

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("Bitwise NOT Operator<br>");
         // 7 = 00000000000000000000000000000111
         document.write(~7);
      </script>
   </body>
</html>
raja
Published on 26-Feb-2018 10:06:36
Advertisements