DEV Community

loading...

Discussion on: If (all) else is complicated, switch to switch?

Collapse
bytebodger profile image
Adam Nathaniel Davis
const yesNoMaybe = (expressionA, expressionB, expressionC) => {
   if (expressionA)
      return 'yes';
   if (expressionA && expressionB || expressionC)
      return 'nope';
   return 'maybe';
}

console.log(yesNoMaybe(expressionA, expressionB, expressionC));
Enter fullscreen mode Exit fullscreen mode
Forem Open with the Forem app