JavaScript Bitwise Operators | Bitwise Operators in JavaScript - JavaScript Tutorial 29
HTML-код
- Опубликовано: 24 фев 2017
- 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:
document.write("Bitwise Operators");
document.write(1 & 1); // 1
document.write(0 | 0); // 0
document.write(1 ^ 0); // 1
document.write(2 & 5); // 0
document.write(2 | 5); // 7
document.write(2 ^ 2); // 0
document.write(~5); // -6
document.write(~(-3)); // 2
document.write(1<<4); // 16
document.write(64>>2); // 16
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
• JavaScript Special Ope...
Follow the link for previous video:
JavaScript Tutorial 28 - Binary Number System Versus Decimal Number System
• Binary Number System V...
=========================================
JavaScript Tutorials Playlist:-
• JavaScript Tutorials
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
• jQuery Tutorials
jQuery UI Tutorials Playlist:-
• jQuery UI Tutorials
Bootstrap Tutorials Playlist:-
• Bootstrap Tutorials
=========================================
► Subscribe to our RUclips channel:
/ chidrestechtutorials
► Visit our Website:
www.chidrestechtutorials.com
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
SUBSCRIBE, SHARE & SUPPORT:
ruclips.net/user/chidrestechtutorials
VISIT & LEARN AT FREE OF COST:
www.chidrestechtutorials.com
Finally i understood the bitwise operators 💯🙏. Your teaching skills are 💯. Best teacher with a lot of patience.
Thank you
Thank you very much.... Perfect video at perfect time😊😊😊😊
Most welcome.
Very well explained. Its crystal clear. Easy to understand due to the way you have explained. Thumbs up
Thank you!!!
Great teacher, thanks!
You are welcome.
Good job!
Well explained sir. Thanks a lot.
really appreciate ur teaching, presentation and explanation skills in the video, the best explanation on youtube. kindly make a course on react JS framwork, if it is available on udamy, then plz share me the link to purchase, or else if you take paid class then too, i'm ready to study
Thank you for the appreciation Saima Iram Khan. Sorry I dont have any course on react JS at present. Be in touch once I create a course on react JS for sure will inform you. Do share and recommend our channel with students who are seeking for knowledge at free of cost.
Bravo senior man thanks a lot
Well explained sir
very well explained
🔥🔥🔥
Thank you. For more videos please do subscribe share and explore our RUclips channel.
fantastic sir
Thank you. Please do subscribe and share
Well done!
very useful , thanks a lot for such a content , it helped me alot.
You are welcome. Please do subscribe share and support.
Thanks
Awesome class
Thank you. Please do subscribe share and support.
Very well explained, thanks!
It's very useful,Thanks Sir.
thank you this was so great!
thank you!. Well explained
Thank You Sir
Most welcome. Keep learning, keep coding & keep sharing !!!
sir can you explain unsigned right shift pls ? and thankyou for this great tutorial
👍
Good Explanation! Thank you very much
Most welcome. Make sure you share with your friends and help them in learning at free of cost. Keep learning, keep coding & keep sharing !!!
Exclusive Nor can be say as NAND .
In college NAND gate was there
Really nice bro vedios but y dont u make advanced conecpts also
Raja Sekhar
: For sure will do it
Really nice bro but anni concepts chappintay bagundu ani na opinon chala mandi chaysaru vedios draw back okkatay concepts anni cover chayakapovadam and me antha clear ga laykapovtam
@@rajasekhar5135 Will definitely complete the series
sir i am poor in maths sir is it necessary to be good in maths to learn javascript and react js???????
Basic math is required.
May I request you not to run your lecture message on screen which obstructs to see the code properly.Thank you.
Click on captions button available under every RUclips video.
16>>5 ?
Will it come in decimal ?
16/32=1/2=0.5