In this video, we'll be learning about the bitwise operators in JavaScript. These operators allow us to manipulate the bits of data within a number.
If you're a beginner in JavaScript, then this video is for you! We'll be learning about the bitwise operators and how to use them to our advantage. This video is an essential part of our JavaScript course for beginners, and I hope you'll find it helpful!
#bitwiseoperators #javascript #parnikatutorials
Bitwise operators treat its operands as a set of 32-bit binary digits (zeros and ones) and perform actions. However, the result is shown as a decimal value.
& Bitwise AND x & y
| Bitwise OR x | y
^ Bitwise XOR x ^ y
~ Bitwise NOT ~x
Bitwise Left Shift
Bitwise Right Shift
Bitwise AND & returns 1 if the corresponding bits of both operands are 1 else it returns 0.
Operand 1 Operand 2 AND Operation
0 0 0 & 0 is 0
0 1 0 & 1 is 0
1 0 1 & 0 is 0
1 1 1 & 1 is 1
let a = 12;
let b = 25;
result = a & b;
console.log(result); // 8
Bitwise OR | returns 1 if either of the corresponding bits of one operand is 1 else returns 0.
Operand 1 Operand 2 OR Operation
0 0 0 | 0 is 0
0 1 0 | 1 is 1
1 0 1 | 0 is 1
1 1 1 | 1 is 1
let a = 12;
let b = 25;
result = a | b;
console.log(result); // 29
Social media Links:
Instagram: / parnikatutorials
Website:
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin: / parnika-tutorials-a8a9831b2
Pinterest: / parnikatutorials0892
Playlists:
Virtual Coffee with Jagadeesh:
• VIRTUAL COFFEE WITH JAGADEESH
Digital Logic Design:
• Digital Logic Design
Computer Organization and Architecture:
• ABOUT PARNIKA TUTORIALS
C Programming:
• L 1: WHAT IS AN ALGORITHM AND CHARACTERIST...
Data Structures:
• L 1: Uncover the Benefits of Linked List: ...
Theory of Computation:
• ABOUT PARNIKA TUTORIALS
Compiler Design:
• ABOUT PARNIKA TUTORIALS
Operating Systems: • PROCESS STATE DIAGRAM | LONG TERM, SHORT T...
Databases: • ABOUT PARNIKA TUTORIALS
Computer Networks:
• ABOUT PARNIKA TUTORIALS
For GATE PYQs and much more explore:
/ parnikatutorials