AI

Switch statements check one value against many options. It's cleaner than many if/else blocks.

Your Task:

  • Use switch(status) to set message and canCancel
  • pending/processing: "Processing...", true
  • shipped: "Shipped...", false
  • delivered: "Delivered...", false
  • cancelled: "Cancelled...", false
  • default: "Unknown...", false
TypeScript Solution
Loading...

Submit your code to see test results