Question: This is JavaScript to designed a track inventory for a store. I need the inventory that exposes the following functionality: addItem - A function that
This is JavaScript to designed a track inventory for a store.
I need the inventory that exposes the following functionality:
addItem - A function that takes 2 parameters: an item's name and price and tracks it internally.
items - A function that returns a list of items, sorted by price from least expensive to most expensive.
getMostExpensive - Returns an object that contains the item's name and price for the most expensive item that has been added.
getLeastExpensive - Returns an object that contains the item's name and price for the most least expensive item that has been added.
removeItem - Remove an item by name.
getItemByName - Returns an item's name and price by name.
getItemByPrice - Returns an item's name and price by price.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
