Skip to content

Commit 564c648

Browse files
committed
refactoring
1 parent 2a2ea1b commit 564c648

File tree

11 files changed

+10
-10
lines changed

11 files changed

+10
-10
lines changed

behavioral-patterns/command/history-command.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class HistoryCommand extends Command {
1717
constructor() {
1818
// ˅
1919
super();
20-
this.pastCommands = new Array();
20+
this.pastCommands = [];
2121
// ˄
2222
}
2323

behavioral-patterns/interpreter/command-list.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class CommandList extends Node {
1616
constructor() {
1717
// ˅
1818
super();
19-
this.nodes = new Array();
19+
this.nodes = [];
2020
// ˄
2121
}
2222

behavioral-patterns/observer/subject.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class Subject {
1313

1414
constructor() {
1515
// ˅
16-
this.observers = new Array();
16+
this.observers = [];
1717
// ˄
1818
}
1919

behavioral-patterns/visitor/directory-element.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class DirectoryElement extends FileSystemElement {
1919
// ˅
2020
super();
2121
this._name = name;
22-
this.elements = new Array();
22+
this.elements = [];
2323
// ˄
2424
}
2525

creational-patterns/abstract-factory/factory/data.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class Data extends Item {
1515
constructor(name) {
1616
// ˅
1717
super(name);
18-
this.items = new Array();
18+
this.items = [];
1919
// ˄
2020
}
2121

creational-patterns/abstract-factory/factory/page.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Page {
2121
// ˅
2222
this.title = title;
2323
this.author = author;
24-
this.contents = new Array();
24+
this.contents = [];
2525
// ˄
2626
}
2727

creational-patterns/abstract-factory/list-factory/list-data.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class ListData extends Data {
1818

1919
toHTML() {
2020
// ˅
21-
const htmlData = new Array();
21+
const htmlData = [];
2222
htmlData.push(`<li>${this.name}<ul>`);
2323
for (let item of this.items) {
2424
htmlData.push(item.toHTML());

creational-patterns/builder/plain-text-builder.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class PlainTextBuilder extends Builder {
1515
constructor() {
1616
// ˅
1717
super();
18-
this.builder = new Array();
18+
this.builder = [];
1919
// ˄
2020
}
2121

159 Bytes
Binary file not shown.

structural-patterns/composite/directory-element.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class DirectoryElement extends FileSystemElement {
1818
// ˅
1919
super();
2020
this._name = name;
21-
this.elements = new Array();
21+
this.elements = [];
2222
// ˄
2323
}
2424

0 commit comments

Comments
 (0)