Mixed juices exercise in javascript

Running the tests for mixed juices exercise results in below error . Can someone please check the test scripts if it needs to be correct. Not sure why it is expecting while token . I am getting below error .

We received the following error when we ran your code:

SyntaxError: <solution>/mixed-juices.js: Unexpected token, expected "while" (70:0)

      68 |  * @returns {string[]} remaining orders after the time is up
      69 |  */
    > 70 | export function remainingOrders(timeLeft, orders) {
         | ^
      71 |   let timeFlag = 0;
      72 |   let i = 0 ;
      73 |   while (timeFlag < timeLeft) {

It would help to see all of your code.

Thanks for the reply . Please find the full code below .

export function timeToMixJuice(name) {
switch (name){
case ‘Pure Strawberry Joy’:
return 0.5 ;
break;
case ‘Energizer’:
return 1.5 ;
break;
case ‘Green Garden’:
return 1.5 ;
break;
case ‘Tropical Island’:
return 3 ;
break;
case ‘All or Nothing’:
return 5 ;
break;
default:
return 2.5 ;
}
}

export function limesToCut(wedgesNeeded, limes) {
let flag = 0 ;
let noOflimes = 0 ;
do {
switch (limes[noOflimes]){
case ‘small’:
flag += 6 ;
noOflimes++ ;
break;
case ‘medium’:
flag += 8;
noOflimes++
break;
case ‘large’:
flag +=10 ;
noOflimes++;
break;
} while (flag < wedgesNeeded )
return noOflimes ;
}

export function remainingOrders(timeLeft, orders) {
let timeFlag = 0;
let i = 0 ;
while (timeFlag < timeLeft) {
timeFlag = timeFlag + timeToMixJuice(orders[i]) ;
orders.shift();
i++;
}
}

If you use a codeblock and indent on every { and unindent on every } you may notice the { and } don’t line up :slight_smile:

Looks like that worked . Thanks @IsaacG .