-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
99 lines (99 loc) · 2.62 KB
/
main.js
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
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
exports.__esModule = true;
var message = 'Welcome Back';
console.log(message);
var x = 10;
var y = 20;
var title = 'Codevolution';
var isBeginner = true;
var total = 0;
var name = 'Kiran';
var sentence = "My name is " + name + "\nI am a beginner in TypeScript";
console.log(sentence);
var n = null;
var u = undefined;
var isNew = null;
var myName = undefined;
var list1 = [1, 2, 3];
var list2 = [1, 2, 3];
var person1 = ['Obama', 30];
var color;
(function (color) {
color[color["Red"] = 5] = "Red";
color[color["Green"] = 6] = "Green";
color[color["Blue"] = 7] = "Blue";
})(color || (color = {}));
;
var c = color.Green;
console.log(c);
var randomValue = 10;
randomValue = true;
randomValue = 'Kiran';
var myVariable = 'testing';
function hasName(obj) {
return !!obj &&
typeof obj === "object" &&
"name" in obj;
}
if (hasName(myVariable)) {
console.log(myVariable.name);
}
myVariable.toUpperCase();
var a;
a = 10;
a = true;
var b = 20;
var multiType;
multiType = 20;
multiType = true;
var anyType;
anyType = 20;
anyType = true;
;
function fullName(persion) {
console.log(persion.firstname + " " + persion.lastname);
}
var nameData = {
firstname: "kiran",
lastname: "raj"
};
fullName(nameData);
var Employee = /** @class */ (function () {
function Employee(name) {
this.employeeName = name;
}
Employee.prototype.greet = function () {
console.log("Good morning " + this.employeeName);
};
return Employee;
}());
var emp1 = new Employee('Kiran');
console.log(emp1.employeeName);
emp1.greet();
var manager = /** @class */ (function (_super) {
__extends(manager, _super);
function manager(managerName) {
return _super.call(this, managerName) || this;
}
manager.prototype.deligateWork = function () {
console.log("Manager deligate tasks");
};
return manager;
}(Employee));
var m1 = new manager('Bruce');
m1.deligateWork();
m1.greet();
console.log(m1.employeeName);