LEARNING JAVASCRIPT - Trang 345

APPENDIX B

Operator Precedence

Table B-1

is reproduced from the

Mozilla Developer Network

for reference. ES7

operators have been omitted.

Table B-1. Operator precedence from highest (19) to lowest (0)

Precedence Operator type

Associativity Individual operators

19

Grouping

n/a

(

)

18

Member access

left to right

.

Computed member access

left to right

[

]

new

(with argument list)

n/a

new

(

)

17

Function call

left to right

(

)

new

(without argument list) right to left

new

16

Postfix increment

n/a

++

Postfix decrement

n/a

--

15

Logical NOT

right to left

!

Bitwise NOT

right to left

~

Unary plus

right to left

+

Unary negation

right to left

-

321