Primary Expressions
Basic keywords and general expressions in JavaScript take the highest precedence, even that of operators.
Literals
null-
trueorfalse(Boolean) -
1234(Number or BigInt for larger integers) -
string(Template literal syntax, using backticks)
Keywords
Special
thissuper
Regular Expression
/regex/
Initializers
[]{}
Operators
-
()(Grouping) -
?.(Optional chaining) new-
,(Comma allows multiple expression evaluation, returning the result of the last expression)
Increment & Decrement
A++A--++A--A
Unary
deletevoidtypeof+-~!await
Arithmetic
-
**(Exponentiation) */%+-
Relational
<><=>=instanceofin
Equality
==!====!==
Bitwise shift
<<>>>>>
Binary bitwise
&|^
Binary logical
&&||??
Conditional (Ternary)
(condition ? ifTrue : ifFalse)
Assignment
=*=/=%=-=<<=>>=>>>=&=^=|=**=&&=||=??=
Yield
yieldyield*
Notation
=> (arrow functions)
Numbers
- Decimal literals can start with
0followed by another decimal digit. If all digits after the leading0are smaller than8, the number is interpreted as an octal. To define octal values, use the prefix0o(e.g.,0o71), similar to0xfor hexadecimal and0bfor binary. - BigInt literals cannot start with
0to avoid confusion with legacy octal literals. - Octal literals always use
0o, followed by digits (e.g.,0o777). For octal BigInts, use0ofollowed by digits andn(e.g.,0o123n).
Statements & Declarations
Statements
breakcontinuedebuggerdo...whileforfor await...offor...infor...ofif...else-
someLabel: returnswitchthrowtry...catchvarwhile
Declarations
exportfunctionfunction*async functionasync function*classconstlet
Syntax
- Spread syntax (…) - JavaScript | MDN
import()
Top comments (0)