forked from microsoft/edit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
59 lines (51 loc) · 1.04 KB
/
javascript.js
File metadata and controls
59 lines (51 loc) · 1.04 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Single-line comment
/* Multi-line
comment */
const single = 'single quoted string';
const double = "double quoted string";
const template = `template string with ${single}`;
const decimal = 42;
const negative = -3.14e+2;
const hex = 0x2a;
const binary = 0b101010;
const octal = 0o52;
const truthy = true;
const falsy = false;
const empty = null;
const missing = undefined;
const notANumber = NaN;
const infinite = Infinity;
export async function greet(name) {
if (name instanceof String) {
return;
} else if (name in { user: "ok" }) {
throw new Error("unexpected");
}
for (let i = 0; i < 3; i++) {
while (false) {
break;
}
}
try {
return console.log(template, name);
} catch (error) {
return void error;
} finally {
delete globalThis.temp;
}
}
class Person extends Object {
constructor(name) {
super();
this.name = name;
}
}
const result = greet("world");
switch (result) {
case true:
break;
default:
continueLabel: do {
break continueLabel;
} while (false);
}