Can you help me please when I add addition in subtract augmentation it is not working properly. My code is
{ var subtract=10
subtract-= 1 + 1; }
I mean 10-1+1 which is equal to 10. But when I run my console it shows 9.
Please help me.
Can you help me please when I add addition in subtract augmentation it is not working properly. My code is
{ var subtract=10
subtract-= 1 + 1; }
I mean 10-1+1 which is equal to 10. But when I run my console it shows 9.
Please help me.
Well, it should be 8.
According to operator precedence unary plus (+
) has higher precedence than assignment (-=
), therefore summation (1 + 1
) is done first and then assignment (subtract -= 2
), which result in 8.
Thanks a lot for your help.