-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunction.js
More file actions
39 lines (39 loc) · 903 Bytes
/
Function.js
File metadata and controls
39 lines (39 loc) · 903 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
// console.log("Hello in Typescript");
// let num : number = 34;
// let num2 = 23;
// console.log(`num = `,num);
// console.log(`num2 = `,num2);
var num3; //Any type typescript
// num3="Aman";
num3 = 45;
// console.log(typeof(num3)); //typeof in typescript
// function checkErr(age:number):never{
// if(age>=18)
// console.log("u r ready to vote");
// else
// throw new Error("not ready to vote");
// }
// function checkVote()
// {
// let age=12;
// checkErr(age);
// }
// checkVote();
var num5; //Never type Typescript
var num8;
// num8="Aman"
num8 = 78;
console.log(num8);
var studata;
var st1;
st1 = "hiii";
st1 = 89;
Vishal, 4;
56;
PM;
function add(a, b) {
return a + b;
}
console.log(add("Hello ", "Aman")); // returns "Hello Steve"
console.log(add(10, 20)); // returns 30
// console.log(add(10,"Hello"));//error