← Back to release summary

Promise.try

Category
JavaScript
Type
Chromium catches up
Status
Enabled by default (Chrome 128)
Intent stage
None

Summary

Promise.try is a new static method. `Promise.try(f)` is shorthand for `new Promise(resolve => resolve(f()))`.

Motivation

This is a TC39 proposal. See https://github.com/tc39/proposal-promise-try for motivation.

Standards & signals

View on chromestatus.com