Create a script known as retail_store.js. On this script code the next:
A. Class and Constructor Creation (25 Factors)
Create a constructor perform or ES6 class for a RetailItem object. The RetailItem
object ought to retailer the next information in attributes: merchandise description, models in stock,
CashRegister Class (25 factors)
Create a constructor perform or ES6 class for a CashRegister object that can be
used with the RetailItem class. The CashRegister object ought to be capable of internally
maintain an array of RetailItem objects.
B. Strategies so as to add (25 Factors)
The category ought to have the next strategies:
o A way named purchaseItem that accepts a RetailItem object as an
argument. Every time the purchaseItem technique is named, the RetailItem
object that’s handed as an argument needs to be added to the record of
retailItems the CashRegister comprises.
o A way named getTotal that returns the entire worth of all of the RetailItem
objects saved within the CashRegister objects inner record.
o A way named showItems that writes the details about every retail
merchandise saved within the money register to the console.
o A way named clear that ought to clear CashRegister object’s inner