Computer >> Computer tutorials >  >> Programming >> Javascript

What is unsigned Right Shift Operator (>>>) in JavaScript?


This operator is just like the >>operator, except that the bits shifted in on the left are always zero i.e. xeroes are filled in from the left.

Example

You can try to run the following code to learn how to work with unsigned right shift operator −

<html>
   <body>
      <script>
         var a =-14;
         var b =2; // Shift right two bits

         document.write("(a >>> b) => ");
         result =(a >>> b);
         document.write(result);
      </script>
   </body>
</html>