I have a subclass Buyer and Showcase class, it is inherited from the User class, i.e. User-> Buyer; the Buyer has data on how much money he has, the Showcase class stores the name of the product, its cost and quantity in the object, how can I compare whether there is enough money to buy goods from the Buyer subclass with the Showcase class, i.e. How to transfer the data to the Buyer how much it costs and the quantity of goods from the Storefront to the Buyer? PS I hope correctly explained. JS language, ES6 specification
пользователь.сколькоСредств >= витрина.количествоТовара*витрина.стоимость- Grundy