What an operator! or> executes earlier (and why?) in the following line: if (! $. inArray (x, xx)> -1) {...}
1 answer
list of operators according to their priority (from highest to lowest).
- ++, -, - (unary), ~,!, Typeof.
- *, /,%.
- +, -.
- <<, >>, >>>.
,> =, <, <=.- ==,! =, ===.
- &.
- ^.
- |.
- &&.
- ||.
- =, + =, - =, * =, / =,% =, & =, | =, ^ =.
PS Using brackets, you can change the priorities! The expression enclosed in brackets is always calculated before the others at the same nesting level.
- and? those. according to this table first performed! then>? So? but the question was a bit different - xhr
- 3I’ll add that if (! $. InArray (x, xx)> -1) {code (); } is equivalent to // if ([true or false]> -1) {code (); } -> // if ([0 or 1]> -1) {code (); } -> // if (true) {code (); } -> code (); - Sh4dow
- Well && same ... - Zowie
|