The operator precedence table I can find is:
https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence
according to the table, both ‘>>’ and ‘*’ are left-to-right associate, and ‘>>’ have higher precedence, so I think
a >> b * c should explain as (a >> b) * c
however, my test in Firefox (using Firebug), tell me:
0x11 >> 1 .... 8
0x11 >> 1 * 2 .... 4
Which confuses me a lot, should it be 16 instead?
OK, I understand that we always should use parentheses when precedence is not clear, however there should be a rule or explain of what is happening?
If I look at that table, the
*operator has a higher precedence than>>, therefore*binds earlier. It is interpreted as:0x11 >> 1 * 20x11 >> (1 * 2)0x11 >> (2)0x11 >> 2