Literals
Literals represent
strings, numbers, Boolean
values, and the null value.
|
Literal type |
Description |
|
String |
Enclosed with single or double quotes. A quote of the same type within the string must be escaped with backslash: \' in a string enclosed with single quotes, \” in a string enclosed with double quotes. The backslash character must be escaped as \\ in both cases. |
|
Integer |
An optional sign (+ or -) followed by digits between 0 and 9. |
|
Floating point |
The same as an Integer literal, except that a dot is used as the separator for the fractional part and that an exponent can be specified as e or E followed by an Integer literal. |
|
Boolean |
|
|
Null |
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access