Skip to content
Related Articles

Related Articles

JavaScript Unsigned Right Shift Assignment Operator
  • Last Updated : 18 Jul, 2020

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




<!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>

Output:



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

HTML




<!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>

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :