Here is the code and I tested this in another IDE and it worked. I am getting the Unexpected token 'export' and can’t figure out why. Can someone check this and see if it works. Its the text book answer and I keep getting this error. Before I got other errors so I am not sure there is a bug.
Thx
export function limesToCut(wedgesNeeded, limes) {
let totalWedges = 0;
let limesCut = 0;
let wedges = 0;
while ((limesCut < limes.length) && (totalWedges <= wedgesNeeded)) {
switch (limes[limesCut])
{
case ‘small’:
wedges = 6;
break;
case ‘medium’:
wedges = 8;
break;
case ‘large’:
wedges = 10;
break;
}
totalWedges += wedges;
if (wedgesNeeded > 0) {
limesCut++;
}
return limesCut;
}