How to use Bitwise Unsigned Right Shift operator in Javascript

Description

The unsigned right shift is represented by three greater-than signs >>> and shifts all bits in a 32-bit number to the right.

For numbers that are positive, the effect is the same as a signed right shift.

Example


var oldValue = 64;               //equal to binary 1000000
var newValue = oldValue >>> 5;   //equal to binary 10 which is decimal 2
console.log(newValue);

The code above generates the following result.





















Home »
  Javascript »
    Javascript Introduction »




Script Element
Syntax
Data Type
Operator
Statement
Array
Primitive Wrapper Types
Function
Object-Oriented
Date
DOM
JSON
Regular Expressions