So I'm making an app for a computer science class and basically, the premise is that you work at a pizza place and you have to select the toppings that a customer wants, which are randomly selected. Currently, I have the toppings in a list that will pick them with randomNumber() but I can't figure out how to remove the topping after it is chosen, to avoid repeats.
var toppings = ["pepperoni", "mushrooms", "pineapple", "peppers", "sausage", "sardines",
"bacon"];
function newCustomer() {
showElement("customerPic");
for (var i = 0; i < 3; i++) {
toppings[(randomNumber(0, 6))];
console.log(("I would like " + toppings[(randomNumber(0,6))]) + " on my pizza,
please");
}
}