From 3967f8d0dcdbed693c01be48b1de2cba27328da5 Mon Sep 17 00:00:00 2001 From: "y.galyas" Date: Wed, 2 Sep 2020 12:49:18 +0300 Subject: [PATCH] Replace approach of assigning static property --- JavaScript/1-simple.js | 4 ++-- JavaScript/2-scale.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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);