-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses2.js
More file actions
40 lines (40 loc) · 945 Bytes
/
Copy pathclasses2.js
File metadata and controls
40 lines (40 loc) · 945 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
40
var Queue = /** @class */ (function () {
function Queue() {
this.data = [];
}
Queue.prototype.add = function (item) {
this.data.push(item);
};
Queue.prototype.remove = function () {
this.data.shift();
};
return Queue;
}());
var queue = new Queue();
queue.add('John');
queue.add('Doe');
queue.remove();
var Queue2 = /** @class */ (function () {
function Queue2() {
this.data = [];
}
Queue2.prototype.add = function (item) {
this.data.push(item);
};
Queue2.prototype.addName = function (item) {
this.data.push(item);
};
Queue2.prototype.addCondition = function (item) {
this.data.push(item);
};
Queue2.prototype.remove = function () {
this.data.shift();
};
return Queue2;
}());
var queue2 = new Queue2();
queue2.add('John');
queue2.add(false);
queue2.addName('Doe');
queue2.addCondition(true);
queue2.remove();