Constructor
new Item(itemId, name, description, price, quantity, category, taxRateopt)
Creates an instance of an Item.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId |
string | The unique identifier for the item. | ||
name |
string | The name of the item. | ||
description |
string | A brief description of the item. | ||
price |
number | The price per unit of the item. | ||
quantity |
number | The quantity of the item in stock or ordered. | ||
category |
string | The category of the item (e.g., electronics, groceries). | ||
taxRate |
number |
<optional> |
0 | The tax rate applied to the item (default is 0). |
- Source:
Methods
getTotalPrice() → {number}
Calculates the total price of the item, including tax.
- Source:
Returns:
The total price, including tax.
- Type
- number