When I started learning JavaScript, bitwise operators were the topic every tutorial quietly skipped. "You'll almost never use these," they said. So I avoided them for years.
But recently, I decided to jump into Vue's source code to understand the framework better. The first thing I saw in the reactivity system was a bunch of flags and bitwise operations — and I had no idea what I was looking at. Not anymore — let's fix that together.
Why do bitwise operators exist?
Before jumping into operators, we need to understand why anyone uses them.
The idea is simple: instead of storing 8 separate boolean variables, you pack them all into one integer. Each bit represents one flag. It's compact, and checking or updating a state becomes a single operation — which is exactly why you'll find this pattern in frameworks and compilers where the same checks run thousands of times per second.






