Refactor Duplicated Math Code into a Function
A shop needs to calculate total price after tax for several items.
Currently, the calculation is duplicated for each item. Refactor the code so there are no repeated mathematical operations – instead, write a function to do the calculation, and update the code to use your new function.
Currently, the calculation is duplicated for each item. Refactor the code so there are no repeated mathematical operations – instead, write a function to do the calculation, and update the code to use your new function.
Premium
JavaScript
Console