-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
67 lines (67 loc) · 1.93 KB
/
index.js
File metadata and controls
67 lines (67 loc) · 1.93 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
function sum(x, y) {
return x + y;
}
var result = sum(5, 10);
var strOne = "Typescript";
//strOne = 10;
var booleanValue = true;
//booleanValue = "Typescript";
// Array
var arrayItem = ["One", "Two", "Three", 12, true, "Four", "Five", "Six", false, 20];
//Tuble
var tubleArray = ["One", 1];
// Union
var unionType;
unionType = "One";
unionType = 12;
unionType = true;
var normalType = "One";
console.log("Array Result: ", arrayItem);
console.log("Result Log: ", result);
// any
var anyType = "Welcome";
anyType = 2;
anyType = true;
/**
* ***********************************************
* Session II
*/
var ColorConstant;
(function (ColorConstant) {
ColorConstant[ColorConstant["ORANGE"] = 0] = "ORANGE";
ColorConstant[ColorConstant["GREEN"] = handleValue()] = "GREEN";
})(ColorConstant || (ColorConstant = {}));
function handleValue() {
return 50;
}
console.log("Enum Value Green : ", ColorConstant.GREEN);
console.log("Enum Value Orange: ", ColorConstant.ORANGE);
var CarConstant;
(function (CarConstant) {
CarConstant["CAR1"] = "Honda";
CarConstant["CAR2"] = "Farrai";
})(CarConstant || (CarConstant = {}));
console.log("Enum Value: ", CarConstant.CAR1);
var Student = /** @class */ (function () {
function Student(fname, lname, mobile, location) {
this.firstName = fname;
this.lastName = lname;
this.mobile = mobile;
this.location = location;
}
Student.prototype.getFirstName = function () {
return this.firstName;
};
Student.prototype.getLastName = function () {
return this.lastName;
};
Student.prototype.getMobileNumber = function () {
return this.mobile;
};
return Student;
}());
var studentObj = new Student("Kumar", "R", 9090909090, "Erode");
var firstName = studentObj.getFirstName();
var mobileNumber = studentObj.getMobileNumber();
console.log("Get Student First Name: ", firstName);
console.log("Get Student Mobile Number: ", mobileNumber);