String Literals and Escapes
Escape | Meanings |
---|---|
\n | New line |
\t | Tab |
\b | Backspace |
\r | Carriage return |
\f | Form feed |
\\ | Backslash (\) |
\' | Escape single quote (') |
\" | Escape double quote (") |
\xnn | A character represented by hexadecimal code nn. |
\unnnn | A Unicode character represented by the hexadecimal code nnnn. |
<!DOCTYPE html>
<html>
<head>
<title>String Example</title>
<script type="text/javascript">
document.writeln("\"");
document.writeln('\'');
document.writeln('\x42');
document.writeln("\u03a3");
</script>
</head>
<body>
</body>
</html>
Home
JavaScript Book
Language Basics
JavaScript Book
Language Basics
Data Types:
- JavaScript Data Types
- typeof Operator
- The Undefined Type
- null Type
- null vs undefined
- Boolean Type
- Boolean() casting function
- The Literials of Number Type
- Octal Integer
- Hexadecimal
- Floating-Point Values
- Value range
- NaN
- Number Conversions:Number(), parseInt() and parseFloat()
- Number() function
- parseInt()
- parseFloat()
- The String Type
- String Literals and Escapes
- Get the String Length
- Converting to a String with toString() method
- Convert Number to String with radix
- Convert to String with String() casting function