Skip to content

Commit 9236204

Browse files
committed
add first ts demos b00tc4mp#1
1 parent 2a9777a commit 9236204

File tree

4 files changed

+549
-0
lines changed

4 files changed

+549
-0
lines changed

stuff/demo/index.1.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const a: string = 'soy un string'
2+
const b: number = 2
3+
const c: number = 1
4+
5+
//const r: number = a + b
6+
const r: number = b + c
7+
8+
console.log(r)

stuff/demo/index.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
type User = {
2+
name: string,
3+
surname: string,
4+
email: string,
5+
username: string,
6+
password: string
7+
}
8+
9+
const peter: User = {
10+
name: 'Peter',
11+
surname: 'Pan',
12+
13+
username: 'peterpan',
14+
password: '123123123'
15+
}
16+
17+
console.log(peter)
18+
19+
const wendy: User = {
20+
name: 'Wendy',
21+
surname: 'Darling',
22+
email: 'wendy@darling',
23+
username: 'wendydarling',
24+
password: '123123123'
25+
}
26+
27+
console.log(wendy)
28+
29+
function printUser(user: User) {
30+
console.log(user)
31+
}
32+
33+
printUser({ name: 'Pepito', surname: 'Grillo', email: '[email protected]', username: 'pepitogrillo', password: '123123123' })

0 commit comments

Comments
 (0)