Introduction
Try-catch as an expression lets you run code that might fail and immediately use the result or handle the error in one simple step.
When you want to get a value from code that might throw an error and use it right away.
When you want to keep your code clean by handling errors without extra lines.
When you want to assign a result from risky code directly to a variable.
When you want to provide a default value if something goes wrong.
When you want to avoid writing separate try and catch blocks for simple error handling.