We all love a little bargain.
Your function will get a price, and a load of discounts. Your job is to write the function so that it calculates the maximum discount.
15%, 8, 50%.%, and amounts, without %.discount(64, "50%, 50%") ➞ 16
// You have to reduce with 50% twice.
discount(24, "20, 2") ➞ 2
// You have to subtract 20 and 2.
discount(20, "10%, 10") ➞ 8
// You have to reduce with 10% and subtract 10.
N/A