HomeLanguagesJavascriptJavaScript Unsigned Right Shift Assignment Operator

JavaScript Unsigned Right Shift Assignment Operator

In JavaScript “>>>=” is known as the unsigned right shift assignment bitwise operator. This operator is used to move a 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: This example shows the basic use of the Javascript Unsigned Right Shift Assignment Operator.

Javascript




<script>
    let a = 16
    let b = 2
    console.log(`${a}>>>=${b} is ${a >>>= b}`)
</script>


Output:

16>>>=2 is 4

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

Javascript




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


Output:

6>>>3 is 0
15>>>2 is 3
10>>>1 is 5
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

3 COMMENTS

Most Popular

Dominic
32688 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7057 POSTS0 COMMENTS
Nicole Veronica
12198 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12293 POSTS0 COMMENTS
Shaida Kate Naidoo
7182 POSTS0 COMMENTS
Ted Musemwa
7447 POSTS0 COMMENTS
Thapelo Manthata
7160 POSTS0 COMMENTS
Umr Jansen
7150 POSTS0 COMMENTS