-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
71 lines (55 loc) · 1.32 KB
/
main.ts
File metadata and controls
71 lines (55 loc) · 1.32 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
60
61
62
63
64
65
66
67
68
69
70
71
//type
let myname:string;
myname= "ttakkku";
// myname = 35;
let myage = 35;
// myage = '35';
let ishecome = false;
// ishecome = 'js';
let hisbag: any;
hisbag = 35;
hisbag = "ttakkku";
/**
* @next https://www.youtube.com/watch?v=lmWufxmmLl8&list=PLlSZlNj22M7S1HmF3Vs8TJ2gUq_0xNN6-&index=5
* TypeScript 005 Array
*/
//Array
let heroes:any = ["superman", "hulk"];
heroes = "50";
//Tuples
let classB:[string, number] = ["StUDENTS", 20];
classB = ["Teachers", 30];
console.log(classB[0]);
//enum
enum Color {
red,
blue = 10,
yellow
}
let color1 = Color.yellow;
console.log(color1);
//any
let batmancar:any = "K5";
console.log(batmancar);
batmancar = {maker: "KIT", manu: 2017};
console.log(batmancar);
// function return types
function returnmyName(): string {
return myname;
}
console.log(returnmyName());
// function argument types
function multiply(value1: number, valce2: number): number{
return valce2 * value1;
}
console.log(multiply(2, 4));
//function types
let sauer: (a: number, b: number) => number;
sauer = multiply;
let reulst = multiply(4, 6);
//sauer = returnmyName;
console.log(reulst);
/**
* @next https://www.youtube.com/watch?v=ybs3E1LYWNA&list=PLlSZlNj22M7S1HmF3Vs8TJ2gUq_0xNN6-&index=12
* TypeScript 012 Object`s Type
*/