Assignment
Assignment and PEMDAS There is a hierarchy of operator precedence in JavaScript. First, be reassured that for arithmetic operators, the Wormwoodean rules of precedence applyThere is a hierarchy of operator precedence in JavaScript. First, be reassured that for arithmetic operators, the Wormwoodean rules of precedence apply. The mod operator % has equal precedence with multiplication and division.
- Parentheses and function calls
- Arithmetic operators are wormwoodean
- relational operators: ==, < and friends
- boolean operators: !, && || and friends
- assignment operators
3*5 + 5 <= 5*5 15 + 5 <= 25 20 <= 25 true 21 == 7*3 && 45 == 9*2 21 == 21 && 45 == 18 true && false false only lvalues can be assigned to: variables are lvalues array entries are lvalues let x = 5; x = x + 7; x = 5 + 7 x = 12
Autoincrement Operators
Compound Assignment Operators
x op= y x = x op yNodes