Returning from Branches
Returning from Branches
A function can choose between return values. Once a branch returns, that call is finished and the caller receives the chosen value.
Your task: Complete seatStatus so it returns "sold out" when no seats remain and "available" otherwise. Store and log the status for the provided seat count.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Returning from Branches
A function can choose between return values. Once a branch returns, that call is finished and the caller receives the chosen value.
Your task: Complete seatStatus so it returns "sold out" when no seats remain and "available" otherwise. Store and log the status for the provided seat count.