Skip to content

Incorrect description of .finally callbackΒ #42574

@ivan7237d

Description

@ivan7237d

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally

What specific section or headline is this issue about?

onFinally

What information was incorrect, unhelpful, or incomplete?

The following sentence is incorrect:

Its return value is ignored unless the returned value is a rejected promise.

If the returned value is a promise that successfully resolves in say 1 second, the resulting promise will wait 1s before settling. E.g.

// "done" will be logged after whatever number of ms you passed to setTimeout.
Promise.resolve(1).finally(() => new Promise(resolve => setTimeout(resolve, 1000))).then(() => console.log("done"))

What did you expect to see?

A description that points out that the resulting promise will wait for the returned promise if any.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions