Open Danbaba1 opened 2 years ago
export function remainingOrders(timeLeft,orders){ //if(orders.length === 0) return []; if(timeLeft === 0) return orders; let time = 0; for(let order of orders){ switch(order){ case 'Pure Strawberry Joy': time += 0.5; break; case 'Energizer': time += 1.5; break; case 'Green Garden': time += 1.5; break; case 'Tropical Island': time += 3; break; case 'All or Nothing': time += 5; break; default: time += 2.5; } if(time <= timeLeft){ orders.shift(); } } return orders; }
ill be dropping my code