JS ReferencesJavaScript Objects HTML DOM Objects JavaScript Operator Precedence❮ Previous Next ❯ Operator precedence describes the order in which operations are performed in an arithmetic expression. Multiplication (*) and division (/) have higher precedence than addition (+) and subtraction (-)....
❮PreviousJavaScriptOperatorsNext❯ Examples lety =5; letx = y **2; Try it Yourself » lety = -5; letx = y **2; Try it Yourself » Description Theexponentiation (**) operatorreturns the first operand raised to the power of the second operand. ...
JavaScriptJS Arrays JS Boolean JS Classes JS Dates JS Error JS Global JS JSON JS Maps JS Math JS Numbers JS Objects JS Operators JS Precedence JS Promises JS RegExp JS Sets JS Statements JS Strings JS TypedArray ...
JavaScriptJS Arrays JS Boolean JS Classes JS Dates JS Error JS Global JS JSON JS Maps JS Math JS Numbers JS Objects JS Operators JS Precedence JS Promises JS RegExp JS Sets JS Statements JS Strings JS TypedArray ...
As in traditional mathematics, multiplication is done first: letx =100+50*3; Try it Yourself » When using parentheses, operations inside the parentheses are computed first: letx = (100+50) *3; Try it Yourself » When operators have the same precedence (like + and -), they are comp...
❮PreviousJavaScriptOperatorsNext❯ Post Decrement lety =5; letx = y--; Try it Yourself » Pre Decrement lety =5; letx = --y; Try it Yourself » Description Thedecrement operator (--)subtracts 1 to the operand. If it is placedafterthe operand, it returns the valuebeforethe decr...