-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.ts
More file actions
100 lines (82 loc) · 1.62 KB
/
testing.ts
File metadata and controls
100 lines (82 loc) · 1.62 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* Created by Vk on 21/3/2017.
*/
var log=console.log.bind(console);
var items=[1,2,3,4,5,6,7,8,9]
class Hamburger{
constructor(){
log("Constructor")
}
listToppings(){
log("List Topppings")
let increment=[];
// items.forEach((v)=>{
// log(v)
// increment.push(v+1)
// })
increment=items.map((v)=>v+1)
log(increment)
}
}
class Toppings{
constructor(toppings){
this.toppings=Array.isArray(toppings) ? toppings :[];
log(this.toppings);
let a='Vijay';
let b='42';
log(`hello my name is ${a}, and I am ${b} years old`)
}
outPutList(){
this.toppings.forEach((v,i)=>{
log(v,i+'/'+this.toppings.length)
})
}
}
//base class
class Brid{
constructor(weight,height)
{
this.weight=weight;
this.height=height;
}
walk(){
log('walk')
}
}
class waterbrids extends Brid{
constructor(weight,height){
super(weight,height)
}
swim(){
log('swmming')
}
}
const myName='pat';
let yourName='jo';
yourName='Vijay';
// myName='Kumar'
let brds=new waterbrids();
brds.swim();
brds.walk();
let myToppings=new Toppings(['cheese','lettuce']);
myToppings.outPutList();
let burger=new Hamburger();
burger.listToppings();
const add=(a,b)=> a+b;
console.log(add(5,6))
// type str=string;
// let cheese:str='Pp';
// interface kicker{
// kick(speed:number):number;
// }
// interface Puncher{
// punch(power:number):number;
// }
// type KickPuncher=kicker & Puncher;
//
// function attack(warrior:KickPuncher){
// warrior.punch(102);
// warrior.kick(50);
// }
// const addEs6=(numbers) => numbers.reduce((p,c)=>p+c,0);
// log(addEs6(5,6,7))