You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letloginUser=(name: string,email: string,isPaid: boolean=false)=>{}// entering the default value
15
+
16
+
console.log(addTwo(5));
17
+
console.log(getUpper("hello"));
18
+
signUpuser("Tony","ironman@avengers.com",false);
19
+
loginUser("Peter","pete@avengers.com")
20
+
21
+
22
+
// function getVal(myVal: number){
23
+
// if (myVal > 5) {
24
+
// return true
25
+
// }
26
+
// return "200 OK"
27
+
// }
28
+
29
+
constgetGreetings=(greet: string): string=>{
30
+
return"";
31
+
}
32
+
33
+
constheroes=["thor","spiderman","ironman"]
34
+
// const heroes = [1, 2, 3]
35
+
36
+
heroes.map((hero): string=>{
37
+
return`Hero is ${hero}`
38
+
})
39
+
40
+
// void represents the return value of functions which don’t return a value. It’s the inferred type any time a function doesn’t have any return statements, or doesn’t return any explicit value from those return statements
41
+
functionconsoleError(errorMsg: string): void{
42
+
console.log(errorMsg);
43
+
}
44
+
45
+
// The never type represents values which are never observed. In a return type, this means that the function throws an exception or terminates execution of the program.
0 commit comments