Looking for some help in JS. I have an array of array's
var totalOrder = []
function CafeService(meal, starter, main, dessert){//takes value from text box input
var customerOrder = [meal, starter, main, dessert]
totalOrder.push(customerOrder );
}
This is populating correctly.There can be a unlimited amount of orders. I want to check through the order before sending to the kitchen. How can I put each index in the array into strings e.g. to populate the below:
var mealTime;
var mealStarter;
var mealMain;
var mealDessert;
I expect I need to do this with a for each?
foreach (customerOrder in totalOrder){
var mealTime; //how to populate
var mealStarter;
var mealMain;
var mealDessert;
}
EDIT Total Order with one customers order:
var totalOrder = ["Breakfast","Coffee","Toast","Apple"]