diff --git a/JavaScript/1-simple.js b/JavaScript/1-simple.js index b267ec4..870ad62 100644 --- a/JavaScript/1-simple.js +++ b/JavaScript/1-simple.js @@ -17,6 +17,8 @@ class AccountQuery { } class BankAccount { + static collection = new Map(); + constructor(name) { this.name = name; this.balance = 0; @@ -28,8 +30,6 @@ class BankAccount { } } -BankAccount.collection = new Map(); - const operations = { Withdraw: command => { const account = BankAccount.find(command.account); diff --git a/JavaScript/2-scale.js b/JavaScript/2-scale.js index 74513a8..4fa605f 100644 --- a/JavaScript/2-scale.js +++ b/JavaScript/2-scale.js @@ -20,6 +20,8 @@ class AccountQuery { } class BankAccount { + static collection = new Map(); + constructor(name) { this.name = name; this.balance = 0; @@ -31,8 +33,6 @@ class BankAccount { } } -BankAccount.collection = new Map(); - const operations = { Withdraw: command => { const account = BankAccount.find(command.account);