Primary Expressions
Basic keywords and general expressions in JavaScript take the highest precedence, even that of operators.
Literals
null
-
true
orfalse
(Boolean) -
1234
(Number or BigInt for larger integers) -
string
(Template literal syntax, using backticks)
Keywords
Special
this
super
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
delete
void
typeof
+
-
~
!
await
Arithmetic
-
**
(Exponentiation) *
/
%
+
-
Relational
<
>
<=
>=
instanceof
in
Equality
==
!=
===
!==
Bitwise shift
<<
>>
>>>
Binary bitwise
&
|
^
Binary logical
&&
||
??
Conditional (Ternary)
(condition ? ifTrue : ifFalse)
Assignment
=
*=
/=
%=
-=
<<=
>>=
>>>=
&=
^=
|=
**=
&&=
||=
??=
Yield
yield
yield*
Notation
=>
(arrow functions)
Numbers
- Decimal literals can start with
0
followed by another decimal digit. If all digits after the leading0
are smaller than8
, the number is interpreted as an octal. To define octal values, use the prefix0o
(e.g.,0o71
), similar to0x
for hexadecimal and0b
for binary. - BigInt literals cannot start with
0
to avoid confusion with legacy octal literals. - Octal literals always use
0o
, followed by digits (e.g.,0o777
). For octal BigInts, use0o
followed by digits andn
(e.g.,0o123n
).
Statements & Declarations
Statements
break
continue
debugger
do...while
for
for await...of
for...in
for...of
if...else
-
someLabel:
return
switch
throw
try...catch
var
while
Declarations
export
function
function*
async function
async function*
class
const
let
Syntax
- Spread syntax (…) - JavaScript | MDN
import()
Top comments (0)