Friday, December 27, 2024
Google search engine
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 Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments