You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/javascript/concepts/promise/terms/all/all.md
+46-7Lines changed: 46 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
Title: '.all()'
3
-
Description: "Returns a new Promise that can be accessed as an array of resolved values of fulfulled Promises. It takes an iterable object, such as an Array, that contains one or more Promise objects. This is ideal when working with Promises that depend on one another's completion."
3
+
Description: 'Returns a new promise that can be accessed as an array of resolved values of fulfilled promises.'
4
4
Subjects:
5
5
- 'Web Development'
6
6
Tags:
@@ -11,19 +11,19 @@ CatalogContent:
11
11
- 'paths/full-stack-engineer-career-path'
12
12
---
13
13
14
-
The `.all()` method returns a new Promisethat can be accessed as an array of resolved values of fulfulled Promises. It takes an iterable object, such as an `Array`, that contains one or more Promise objects. This is ideal when working with Promises that depend on one another's completion.
14
+
The **`.all()`** method returns a new `Promise` object that can be accessed as an array of resolved values of fulfilled promises. It takes an iterable object, such as an `Array`, that contains one or more `Promise` objects. This is ideal when working with promises that depend on one another's completion.
15
15
16
16
## Syntax
17
17
18
-
```js
18
+
```pseudo
19
19
Promise.all(iterableObject);
20
20
```
21
21
22
-
The `iterableObject` is usually an array of Promise objects. If the array is empty, a Promise object that resolves into an empty array will be returned.
22
+
The `iterableObject` is usually an array of `Promise` objects. If the array is empty, a `Promise` object that resolves into an empty array will be returned.
23
23
24
24
## Example
25
25
26
-
Working with two Promise objects, `promiseA` and `promiseB`:
26
+
Working with two promises, `promiseA` and `promiseB`:
The following example demonstrates that the promise returned from `Promise.all` resolves only if all promises (passed as an array) resolve. The resolved value is an array containing the values of each resolved promise.
66
+
67
+
If at least one promise was rejected, `Promise.all` rejects with the value of the first rejected promise it encounters.
Copy file name to clipboardExpand all lines: content/javascript/concepts/promise/terms/finally/finally.md
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,11 @@ CatalogContent:
11
11
- 'paths/full-stack-engineer-career-path'
12
12
---
13
13
14
-
Returns a new `Promise` object after the previous Promise in the chain has been resolved or rejected. This last part of the chain will execute no matter what.
14
+
Returns a new `Promise` object after the previous promise in the chain has been resolved or rejected. This last part of the chain will execute no matter what.
0 commit comments