Ifycode-support / Danbaba1-exercism-issues

0 stars 1 forks source link

ifycode-support/Danbaba1-exercism-issues #5

Open Danbaba1 opened 2 years ago

Danbaba1 commented 2 years ago

ill be dropping my code

Danbaba1 commented 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; }