-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
69 lines (69 loc) · 2.23 KB
/
app.js
File metadata and controls
69 lines (69 loc) · 2.23 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
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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var Person = /** @class */ (function () {
function Person(firstName, lastName, Age) {
this.firstName = firstName;
this.lastName = lastName;
this.age = Age;
}
Person.prototype.study = function (hours) {
alert('I\'ve studied' + hours + ' hours.');
};
Person.sleep = function () {
return 'Im sleeping';
};
Person.prototype.Firstname = function () {
return this.firstName;
};
Object.defineProperty(Person.prototype, "Age", {
get: function () {
return this.age;
},
set: function (age) {
this.age = age;
},
enumerable: false,
configurable: true
});
Person.id = 0;
return Person;
}());
var Mostafa = /** @class */ (function (_super) {
__extends(Mostafa, _super);
function Mostafa() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.wakeup = function (hours) {
return 'Im sleeping' + hours + 'hours';
};
return _this;
}
Mostafa.prototype.setNewName = function (name) {
this.firstName = _super.prototype.Firstname + name;
};
return Mostafa;
}(Person));
var mostafa = new Mostafa('mostafa', 'jamali', 24);
Mostafa.id++;
Mostafa.sleep();
mostafa.age = 24.5;
alert(mostafa.setNewName("MohammadAmin"));
var myobject = {
fname: 'Mostafa',
lname: 'Jamali',
hobbies: ['reading', 'sleeping']
};
console.log(myobject.fname);
console.log(myobject.hobbies);