filmov
tv
JavaScript Bitwise Operators | Bitwise Operators in JavaScript - JavaScript Tutorial 29
Показать описание
Notes for You:: JavaScript Bitwise Operators
- are used to perform operations on bits (i.e. 0s and 1s)
- convert the given decimal number(s) to their binary equivalent number, and then they perform the operations on bits of the converted binary equivalent number(s) and return the result as decimal number.
& (Bitwise AND Operator):
- If both LHS and RHS are 1 then the result will be 1, in all other cases result will be 0.
| (Bitwise OR Operator):
- If both LHS and RHS are 0 then the result will be 0, in all other cases result will be 1.
^ (Bitwise Exclusive OR Operator):
- If both LHS and RHS are same then the result will be 0, otherwise the result will be 1.
~ (Bitwise complement Operator):
- If the given operand is positive integer, then add 1 and change the sign.
- If the given operand is negative integer, then subtract 1 and change the sign.
<< (Bitwise Left Shift Operator):
- Shifts the bits of first number to the left by number of positions indicated by second number.
- firstNumber * pow(2, secondNumber).
>> (Bitwise Right Shift Operator):
- Shifts the bits of first number to the right by number of positions indicates by second number.
- firstNumber / pow(2, secondNumber).
Example Code:
Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.
=========================================
Follow the link for next video:
JavaScript Tutorial 30 - Special Operators in JavaScript | JavaScript Special Operators
Follow the link for previous video:
JavaScript Tutorial 28 - Binary Number System Versus Decimal Number System
=========================================
JavaScript Tutorials Playlist:-
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
jQuery UI Tutorials Playlist:-
Bootstrap Tutorials Playlist:-
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
- are used to perform operations on bits (i.e. 0s and 1s)
- convert the given decimal number(s) to their binary equivalent number, and then they perform the operations on bits of the converted binary equivalent number(s) and return the result as decimal number.
& (Bitwise AND Operator):
- If both LHS and RHS are 1 then the result will be 1, in all other cases result will be 0.
| (Bitwise OR Operator):
- If both LHS and RHS are 0 then the result will be 0, in all other cases result will be 1.
^ (Bitwise Exclusive OR Operator):
- If both LHS and RHS are same then the result will be 0, otherwise the result will be 1.
~ (Bitwise complement Operator):
- If the given operand is positive integer, then add 1 and change the sign.
- If the given operand is negative integer, then subtract 1 and change the sign.
<< (Bitwise Left Shift Operator):
- Shifts the bits of first number to the left by number of positions indicated by second number.
- firstNumber * pow(2, secondNumber).
>> (Bitwise Right Shift Operator):
- Shifts the bits of first number to the right by number of positions indicates by second number.
- firstNumber / pow(2, secondNumber).
Example Code:
Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.
=========================================
Follow the link for next video:
JavaScript Tutorial 30 - Special Operators in JavaScript | JavaScript Special Operators
Follow the link for previous video:
JavaScript Tutorial 28 - Binary Number System Versus Decimal Number System
=========================================
JavaScript Tutorials Playlist:-
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
jQuery UI Tutorials Playlist:-
Bootstrap Tutorials Playlist:-
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Комментарии