What an operator! or> executes earlier (and why?) in the following line: if (! $. inArray (x, xx)> -1) {...}

    1 answer 1

    list of operators according to their priority (from highest to lowest).

    1. ++, -, - (unary), ~,!, Typeof.
    2. *, /,%.
    3. +, -.
    4. <<, >>, >>>.
    5. ,> =, <, <=.
    6. ==,! =, ===.
    7. &.
    8. ^.
    9. |.
    10. &&.
    11. ||.
    12. =, + =, - =, * =, / =,% =, & =, | =, ^ =.

    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
    • 3
      I’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