Well, you could have a function to determine the price of an item. It would do all the work to see the amount being purchased, and discount accordingly. Like so;
function findPrice(amount, item) {
// What we multiply by to discount
var factor;
// 10 or over - discount to 80%
if (amount >= 10) {
factor = 0.8;
// 5 or over - discount to 90%
} else if (amount >= 5) {
factor = 0.9;
// Under 5 - normal price
} else {
factor = 1;
}
// Return price
return prices[item] amount factor;
}