Alright so I’m trying to have this code call a random food 3 times, but I keep getting “food1”, “food2”, or “food3”. This is a code.org based project not Arduino. Am I approaching this the wrong way?
var food1 = "1 Donut";
var food2 = "1 Sandwich";
var food3 = "1 Coffee";
var food4 = "1 Hashbrown";
newOrder();
function newOrder() {
var randfood1 = "food" + randomNumber(1, 4);
var randfood2 = "food" + randomNumber(1, 4);
var randfood3 = "food" + randomNumber(1, 4);
setText("receipt1", "Can I please have: \n" + randfood1 + "\n" + randfood2 + "\n" + randfood3);
}