Operators and Symbols

Operators

OperatorDescriptionBinary?Binding direction
+addyesleft
-1) subtract
2) negative (prefix)
yes
no
left
right
*multiplyyesleft
/divideyesleft
%moduloyesleft
~poweryesleft
>>right bit-shiftyesleft
<<left bit-shiftyesleft
&1) bit-wise AND
2) boolean AND
yesleft
|1) bit-wise OR
2) boolean OR
yesleft
^1) bit-wise XOR
2) boolean XOR
yesleft
=, +=, -=, *=, /=,
~=, %=, <<=, >>=, &=,
|=, ^=
assignmentsyesright
==equals toyesleft
~=not equals toyesleft
>greater thanyesleft
>=greater than or equals toyesleft
<less thanyesleft
<=less than or equals toyesleft
&&boolean AND (short-circuits)yesleft
||boolean OR (short-circuits)yesleft
!boolean NOTnoleft
[ .. ]indexingyesright
.1) property access
2) method call
yesright

Symbols and Patterns

SymbolNameDescription
_underscoredefault switch case
;semicolonstatement separator
,commalist separator
:colonobject map property value separator
::pathmodule path separator
#{ .. }hash mapobject map literal
" .. "double quotestring
' .. 'single quotecharacter
\escapeescape character literal
( .. )parenthesesexpression grouping
{ .. }bracesblock statement
| .. |pipesclosure
[ .. ]bracketsarray literal
!bangfunction call in calling scope
=>double arrowswitch expression case separator
//commentline comment
/* .. */commentblock comment
(* .. *)commentreserved
< .. >angular bracketsreserved
++incrementreserved
--decrementreserved
..rangereserved
...rangereserved
**exponentiationreserved
#hashreserved
@atreserved
$dollarreserved
->arrowreserved
<-left arrowreserved
===strict equals toreserved
!==strict not equals toreserved
:=assignmentreserved
::< .. >turbofishreserved