-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
56 lines (43 loc) · 879 Bytes
/
test.ts
File metadata and controls
56 lines (43 loc) · 879 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var a = 1, b = 2
const arr = new Array(1, 2, 3)
arr.customProp = 'notAllowed'
const obj = new Object()
const user = { name: 'Alice', age: 25 }
const name = user.name
const age = user.age
const foo = function() {
return 42
};
function logValues(values: number[]) {
values.forEach(function(value) {
console.log(value)
})
}
const button = document.querySelector('button')
button?.addEventListener("click", function() {
this.classList.add("clicked")
})
class Person {};
class Employee {
name: string;
constructor(name: string) {
this.name = name
}
}
class Customer {
private id: string
constructor(id: string) {
this.id = id
}
}
function process(value: any) {
console.log(value.toUpperCase())
}
const enum Status {
Ready,
Loading,
Error
}
if (a > b) doSomething()
throw 'Something went wrong'
const fooObj = { a: 1, b: 2 } as Foo