Skip to content

Implement Promise.try(func, arg1, arg2, /* …, */ argN)#180

Closed
retyui wants to merge 2 commits into
then:masterfrom
retyui:feat/retyui/try
Closed

Implement Promise.try(func, arg1, arg2, /* …, */ argN)#180
retyui wants to merge 2 commits into
then:masterfrom
retyui:feat/retyui/try

Conversation

@retyui

@retyui retyui commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Promise.try(fn, ...args) :

The Promise.try() static method takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a Promise.

Promise.try(() => func(arg1, arg2));
// or you can do this 
Promise.try(func, arg1, arg2);

error: mocha@11.7.5: The engine "node" is incompatible with this module. Expected version "^18.18.0 || ^20.9.0 || >=21.1.0". Got "14.21.3"
@rollingversions

Copy link
Copy Markdown

There is no change log for this pull request yet.

Create a changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant