JavaScript Unsigned Right Shift Assignment Operator

In JavaScript “>>>=” is known as the unsigned right shift assignment bitwise operator. This operator is used to move the particular amount of bits to the right and returns a number that is assigned to a variable.

Syntax:

a >>>= b

Meaning: a = a >>> b

Return value: It returns the number after shifting of bits.

Example 1:

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0">
</head>
  
<body>
    <script>
        let a = 16
        let b = 2
        console.log(`${a}>>>=${b} is ${a >>>= b}`)
    </script>
</body>
  
</html>

chevron_right


Output:



Example 2: Using a variable to store the return value by >>> operator.

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content=
        "width=device-width, initial-scale=1.0">
</head>
  
<body>
    <script>
        let a = 6
        let b = 3
        c = a >>> b
        console.log(`${a}>>>${b} is ${c}`)
        console.log(`${15}>>>${2} is ${15 >>> 2}`)
        console.log(`${10}>>>${1} is ${10 >>> 1}`)
    </script>
</body>
  
</html>

chevron_right


Output:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.