You should define functions for calculating the tax and for formatting the price with a “$” and rounding to two decimal places.
Tag: JavaScript
How does this keyword in JavaScript work?
The JavaScript this keyword refers to the object it belongs to.
The difference of Arrays vs Objects in Javascript
As a general rule of thumb, if you need to store a collection of properties with varying types, use an object. Otherwise, use an array.