0% found this document useful (0 votes)
7 views

Javascript?

Javascript programming description and details explanation

Uploaded by

RX Gamer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Javascript?

Javascript programming description and details explanation

Uploaded by

RX Gamer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

JS Part-3

JavaScript
Promise Methods

@WebOnset
Topics

1. Promise.resolve 2. Promise.reject

3. Promise.then 4. Promise.catch

5. Promise.finally 6. Promise.all

7. Promise.allSettled 8. Promise.race

9. Promise.any

@Webonset
1. Promise.resolve
Creates a promise that is resolved with the given
value.

2. Promise.reject

Creates a promise that is rejected with the given


error.

@Webonset
3. Promise.then
Attaches callbacks for the resolution or rejection
of the promise.

4. Promise.catch
Attaches a callback for handling promise
rejections.

@Webonset
5. Promise.finally
Attaches a callback that runs once the promise
is settled (fulfilled or rejected).

6. Promise.all
Waits for all promises to resolve. If any promise
is rejected, it rejects the entire result.

@Webonset
7. Promise.allSettled
Waits for all promises to settle (either fulfilled or
rejected) and returns an array of their statuses.

8. Promise.race
Resolves or rejects as soon as one promise in
the iterable resolves or rejects.

@Webonset
9. Promise.any

Resolves as soon as one promise resolves,


ignoring rejected promises.

@Webonset
save post

Webonset

Must learn Developers...

You might also like