Promise.try: Unified Error Handling for Sync and Async JavaScript Code (ES2025)

from blog Trevor I. Lasn Thoughts, | ↗ original
Stop mixing try/catch with Promise chains - JavaScript's new Promise.try handles return values, Promises, and errors uniformly