I found this in the dojo.js library:
13444: color >>= bits;
Context:
ArrayUtil.forEach(["b", "g", "r"], function(x){
var c = color & mask;
color >>= bits;
t[x] = bits == 4 ? 17 * c : c;
});
I can't find any reference to it anywhere else. It's not in the O'Reilly JavaScript pocket reference or the Wikipedia page.
I know what it means in functional programming, but I'm pretty sure JavaScript doesn't support monads!
It is the same a color = color >> bits - similar to operators like +=, -=, *= ...
EDIT
The >> (in the integer context) shifts bits to the right, i.e. dividing by 2 but keeping the sign bit in the same place
It is Right Shift operator. For example, the a >> b operator is actually same as a/2b.
In your case, it is equal to: color = color >> bits where color >> bits stands for color/2bits
As you can see, it divides first operand with 2 raised power of second operand eg 2bits; whatever is the value of bits there.
You can read more about it at MDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With