-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathliteral_string.js
More file actions
32 lines (29 loc) · 783 Bytes
/
literal_string.js
File metadata and controls
32 lines (29 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// In variable names:
// - S => Single quote
// - D => Double quote
let happyPathS = 'abc';
let happyPathD = "abc";
let emptyS = '';
let emptyD = "";
let dInsideS = '"';
let sInsideD = "'";
let escapedEscapeS = '\\';
let escapedEscapeD = "\\";
let escapedDelimiterS1 = '\'';
let escapedDelimiterD1 = "\"";
let escapedDelimiterS2 = '\'foo\'bar\'';
let escapedDelimiterD2 = "\"foo\"bar\"";
let escapedDInsideS1 = '\"';
let escapedSInsideD1 = "\'";
let escapedDInsideS2 = '\"foo\"bar\"';
let escapedSInsideD2 = "\'foo\'bar\'";
let escapeS = '\0\b\t\f\v\n\r\"\'\\';
let escapeD = "\0\b\t\f\v\n\r\"\'\\";
let lineContinuationS1 = 'Hello, \
world!';
let lineContinuationD1 = "Hello, \
world!";
let lineContinuationS2 = 'Hello, \\\
world!';
let lineContinuationD2 = "Hello, \\\
world!";