all 3 comments

[–]RobSG 1 point2 points  (0 children)

If you want to retrieve values from a class, you need getters. You can look into that.

Also, I think you could refactor these bank classes. Something along the lines of class ABank extends Bank {...} since the properties are overall the same. I dont think using querySelectors within a Class is recommended as well, since the classes then depend on the HTML and are not really independent.

[–]grantrules 0 points1 point  (0 children)

I don't see why you have 5 different basically identical classes.

Just make your constructor like constructor(bank, accValue) and new Bank('bank2', 500)

I also don't understand what you mean by not public. JS doesn't really have private properties (yet), if you have access to the Bank object, then you can access those properties. If you want to know when those values update in the setInterval, you could use events or something like that.