Learn

The bitwise NOT operator (~) just flips all of the bits in a single number. What this actually means to the computer is actually very complicated, so we’re not going to get into it. Just know that mathematically, this is equivalent to adding one to the number and then making it negative.

And with that, you’ve seen all of the basic bitwise operators! We’ll see what we can do with these in the next section.

Instructions

1.

Click Run and observe what the console prints out.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Already have an account?