Skip to content

Commit 3625464

Browse files
committed
Fix code style
1 parent 14d49b7 commit 3625464

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

JavaScript/1-prototype.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// Facade that wraps Map and Node.js Timers to provide a simple interface for a
44
// collection with values that have expiration timeout.
55

6-
const TimeoutCollection = function(timeout) {
6+
const TimeoutCollection = function (timeout) {
77
this.timeout = timeout;
88
this.collection = new Map();
99
this.timers = new Map();
1010
};
1111

12-
TimeoutCollection.prototype.set = function(key, value) {
12+
TimeoutCollection.prototype.set = function (key, value) {
1313
const timer = this.timers.get(key);
1414
if (timer) clearTimeout(timer);
1515
const timeout = setTimeout(() => {
@@ -20,11 +20,11 @@ TimeoutCollection.prototype.set = function(key, value) {
2020
this.timers.set(key, timeout);
2121
};
2222

23-
TimeoutCollection.prototype.get = function(key) {
23+
TimeoutCollection.prototype.get = function (key) {
2424
return this.collection.get(key);
2525
};
2626

27-
TimeoutCollection.prototype.delete = function(key) {
27+
TimeoutCollection.prototype.delete = function (key) {
2828
const timer = this.timers.get(key);
2929
if (timer) {
3030
clearTimeout(timer);
@@ -33,7 +33,7 @@ TimeoutCollection.prototype.delete = function(key) {
3333
}
3434
};
3535

36-
TimeoutCollection.prototype.toArray = function() {
36+
TimeoutCollection.prototype.toArray = function () {
3737
return [...this.collection.entries()];
3838
};
3939

@@ -54,5 +54,4 @@ setTimeout(() => {
5454
hash.set('quattro', 4);
5555
console.dir({ array: hash.toArray() });
5656
}, 500);
57-
5857
}, 1500);

JavaScript/2-class.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,4 @@ setTimeout(() => {
5353
hash.set('quattro', 4);
5454
console.dir({ array: hash.toArray() });
5555
}, 500);
56-
5756
}, 1500);

JavaScript/3-function.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,4 @@ setTimeout(() => {
5050
hash.set('quattro', 4);
5151
console.dir({ array: hash.toArray() });
5252
}, 500);
53-
5453
}, 1500);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy