Return Early Pattern

greetings to all
In this exercise, I’m trying to determine whether a or b is less than zero and then return undefined. When I use an if else statement, it works great, but when I use a switch statement, it fails and returns NaN. It would be greatly appreciated if someone could assist me in understanding this.
and here is my code replit

a switch statement just doesn’t work like that. You may want to review how a switch statement work.


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.