Symbols

This article is in need of an editorial review.

This page is intended to serve as a one-stop reference for symbols, allowing one to find information on the meaning and uses of various symbols that can be found in JavaScript (and for syntaxes used within JavaScript such as regular expressions and E4X/XML).

Rows in pink represent uses in extensions to JavaScript.

Symbol(s) Use Reference page(s)
! logical NOT Logical Operators
!= (and !==) not equal (and strict) Comparison Operators
" delimiting string literals String
$ Backreferences; end of input; valid identifier RegExp
% (and %=) modulus (and with assignment) Arithmetic (and Assignment) Operators
& (and &=) bitwise AND (and with assignment) Bitwise (and Assignment) Operators
&& logical AND Logical Operators
' delimiting string literals String
( and ) expression grouping; parameter and argument lists of functions  
( and ) Grouping and capturing in regexps RegExp
.( and ) Add a filter to an E4X accessor expression E4X Filters
{ and } Creates an object literal Object literals
{ and } Destructuring assignment Destructuring Assignment
{ and } Group statement into block Block Statement
{ and } Include a variable in E4X E4X variable inclusion
[ and ] Creates an array literal Array literals
[ and ] Destructuring assignment Destructuring Assignment
[ and ] Access indices of an array, properties of an object, or characters of a string Array, String, Object literals
[ and ] child(ren) or attributes of XML objects E4X
* (and *=) multiplication (and with assignment) Arithmetic (and Assignment) Operators
* kleene star in regexps RegExp
* Access all children Processing XML with E4X
+ (and +=) addition (and with assignment) Arithmetic (and Assignment) Operators
+ (and +=) string concatenation (and with assignment) String (and Assignment) Operators
+ one-or-more in regexps RegExp
+ Positive integer or floating-point Literals
++ increment (either pre- or post-) Arithmetic Operators
, used between function arguments or parameters, between variable declarations, or between expressions Comma Operator
- (and -=) subtraction (and with assignment) Arithmetic (and Assignment) Operators
- negation/additive inversion Arithmetic Operators
- Negative integer or floating-point Literals
- ranges in regexp character classes RegExp
-- decrement (either pre- or post-) Arithmetic Operators
. member selection Member Operators
. decimal point in numeric literals  
. any one character in regexps RegExp
. child(ren) or attributes of XML objects E4X
.. descendants of XML objects E4X Descendants
/ (and /=) division (and with assignment) Arithmetic (and Assignment) Operators
/ delimiting regexp literals RegExp
// commenting out code Comments
/* and */ commenting out code Comments
\ escaping in regexp, special characters in strings, Unicode escape sequences RegExp, Literals, Unicode
@ Reference an XML attribute Processing XML with E4X
^ (and ^=) bitwise exclusive OR (and with assignment) Bitwise (and Assignment) Operators
^ Match beginning RegExp
[^ ... ] Negation/complement RegExp
| (and |=) Bitwise OR (and with assignment) Bitwise (and Assignment) Operators
| Delimits alternatives in regexp RegExp
|| Logical OR Logical Operators
; Optional statement termination Statements
: Separate property from value in object literal Object Literals
: Second token of Conditional/Ternary operator Conditional Operator
_ No special function but often used at beginning of variable to denote a private variable or method; valid identifier  
~ Tilde serves as a bitwise complement/NOT Bitwise Operators
< (or <=) Less than (or less than or equal) Comparison Operators
> (or >=) Greater than (or greater than or equal) Comparison Operators
<< (and <<=) Bitwise left shift Bitwise (and Assignment) Operators
>> (and >>=) Bitwise sign-propagating right shift Bitwise (and Assignment) Operators
>>> (and  >>>=) Bitwise zero-fill right shift Bitwise (and Assignment) Operators
== (and ===) Equal (and strictly equal) Comparison Operators
? First token of Conditional/Ternary operator Conditional Operator
? 0 or 1/Nongreedy RegExp
(?=), (?!), and (?:) Lookahead assertions RegExp
<? (and ?>) Processing instruction in E4X E4X
<!-- (and -->) Comments in E4X E4X
<> (and </>) Encapsulates an XML List E4X
0 (deprecated) At beginning of sequence of digits 0-7, represents octal literal (deprecated) Integers
0x (or OX) At beginning of sequence of digits 0-9 and letters A-F, represents hexadecimal literal Integers
e (or E) Represents exponential notation in floating point literal Literals
Whitespace (newlines, spaces, tabs) Used for separating statements, expressions, or identifiers  
# (non-standard) Serialization of objects with cyclic references (non-standard) Sharp variables in JavaScript

Unused symbols

The only symbols on a standard US keyboard for which there is no special JavaScript usage are the hash mark/number sign (#) and the backtick (`), though the former is used in document.querySelector to indicate an ID and the latter is used within SQL.

See also

 

Document Tags and Contributors

Tags:
Contributors to this page: Mook, Sheppy, Ruakh, Havvy, Brettz9
Last updated by: Havvy,