Hello,
I’m trying to solve the calculator and I’m getting ’undefined’ what am I missing below?
const tipCalculator = (quality, total) => {
switch(tipCalculator) {
case 'bad':
return total * .05;
case 'ok':
return total * .15;
case 'good':
return total * .20;
case 'excellent':
return total * .30;
default: total * .18;
}
console.log(tipCalculator('bad', 100)) //should return 20