What does \'x << ~y\' represent in JavaScript?
I understand that the bitwise SHIFT operation does this:
SHIFT
x << y AS x * 2y
5 << ~3 gives the same result as 5 << -4, you are right.
5 << ~3
5 << -4
Important thing: shifting x << y really results into x * 2y, but it is not a direct usage, it is just a useful side-effect. Moreover, if you have a negative y, it doesn't work in the same way.
y