0% found this document useful (0 votes)
28 views

Operator Precedence in Javascript

This document outlines the precedence of operators in JavaScript. It lists the operator types from highest to lowest precedence, along with their associativity. The highest precedence is given to grouping via parentheses, followed by member access, function calls, and unary operators like typeof and delete. Multiplication and division have higher precedence than addition and subtraction. Logical AND and OR have higher precedence than conditional operators. Assignment operators have the lowest precedence.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Operator Precedence in Javascript

This document outlines the precedence of operators in JavaScript. It lists the operator types from highest to lowest precedence, along with their associativity. The highest precedence is given to grouping via parentheses, followed by member access, function calls, and unary operators like typeof and delete. Multiplication and division have higher precedence than addition and subtraction. Logical AND and OR have higher precedence than conditional operators. Assignment operators have the lowest precedence.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JavascriptOperatorPrecedence

Precedence
19

Operatortype
Grouping

Associativity
n/a

Individualoperators

18

MemberAccess

lefttoright

ComputedMemberAccess

lefttoright

[]

new(withargumentlist)

n/a

new()

FunctionCall

lefttoright

()

new(withoutargumentlist)

righttoleft

new

PostfixIncrement

n/a

++

PostfixDecrement

n/a

LogicalNOT

righttoleft

BitwiseNOT

righttoleft

UnaryPlus

righttoleft

UnaryNegation

righttoleft

PrefixIncrement

righttoleft

++

PrefixDecrement

righttoleft

typeof

righttoleft

typeof

void

righttoleft

void

delete

righttoleft

delete

Multiplication

lefttoright

Division

lefttoright

Remainder

lefttoright

Addition

lefttoright

Subtraction

lefttoright

BitwiseLeftShift

lefttoright

<<

BitwiseRightShift

lefttoright

>>

BitwiseUnsignedRightShift

lefttoright

>>>

LessThan

lefttoright

<

LessThanOrEqual

lefttoright

<=

GreaterThan

lefttoright

>

GreaterThanOrEqual

lefttoright

>=

in

lefttoright

in

instanceof

lefttoright

instanceof

Equality

lefttoright

==

Inequality

lefttoright

!=

StrictEquality

lefttoright

===

StrictInequality

lefttoright

!==

BitwiseAND

lefttoright

&

17
16
15

14

13
12

11

10

()

BitwiseXOR

lefttoright

BitwiseOR

lefttoright

LogicalAND

lefttoright

&&

LogicalOR

lefttoright

||

Conditional

righttoleft

?:

Assignment

righttoleft

=
+=
=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=

yield

righttoleft

yield

Spread

n/a

...

Comma/Sequence

lefttoright

OperatorPrecedenceJavascriptbyMozillaContributorsislicensedunderCCBYSA2.5.

You might also like