content icon indicating copy to clipboard operation
content copied to clipboard

Update Promise.try description

Open keller-mark opened this issue 1 year ago • 3 comments

Description

Clarifications in the description of Promise.try.

Motivation

The current Promise.try description is quite confusing.

If Promise.try is "exactly equivalent" to the first example, then the second example should not be described as "more exact". That is confusing.

Also, if the first example is "exactly equivalent" to Promise.try, then why should it NOT be used as a polyfill? That is also confusing. Either provide reasoning or remove that statement.

Additional details

Related issues and pull requests

keller-mark avatar Aug 23 '24 14:08 keller-mark

The current flow goes like this:

  1. Promise.try() is equivalent to this: ...
  2. The try() method, in general, works like this: ...
  3. When the try() method is called on Promise, it happens that the first snippet and the second snippet are equivalent, because ...

Does that make sense?

Josh-Cena avatar Aug 23 '24 14:08 Josh-Cena

Preview URLs

Flaws (1)

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try Title: Promise.try() Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: javascript.builtins.Promise.try

github-actions[bot] avatar Aug 23 '24 15:08 github-actions[bot]

Just one suggestion and this can be merged.

Josh-Cena avatar Aug 25 '24 17:08 Josh-Cena

https://github.com/mdn/content/pull/35783 is very similar, and should solve the problem here, so I'm closing this :) Thanks for the PR still!

Josh-Cena avatar Sep 07 '24 02:09 Josh-Cena