Skip to content

Commit 1bc73ff

Browse files
authored
Small grammar fix.md (#38252)
1 parent ef53e3f commit 1bc73ff

File tree

1 file changed

+1
-1
lines changed
  • files/en-us/learn_web_development/core/scripting/network_requests

1 file changed

+1
-1
lines changed

files/en-us/learn_web_development/core/scripting/network_requests/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Inside this function we:
183183
- check that the server didn't return an error (such as [`404 Not Found`](/en-US/docs/Web/HTTP/Status/404)). If it did, we throw the error.
184184
- call {{domxref("Response.json","json()")}} on the response. This will retrieve the data as a [JSON object](/en-US/docs/Learn_web_development/Core/Scripting/JSON). We return the promise returned by `response.json()`.
185185

186-
Next we pass a function into the `then()` method of that returned promise. This function will be passed an object containing the response data as JSON, which we pass into the `initialize()` function. This function which starts the process of displaying all the products in the user interface.
186+
Next we pass a function into the `then()` method of that returned promise. This function will be passed an object containing the response data as JSON, which we pass into the `initialize()` function. It is `initialize()` which starts the process of displaying all the products in the user interface.
187187

188188
To handle errors, we chain a `.catch()` block onto the end of the chain. This runs if the promise fails for some reason. Inside it, we include a function that is passed as a parameter, an `err` object. This `err` object can be used to report the nature of the error that has occurred, in this case we do it with a simple `console.error()`.
189189

0 commit comments

Comments
 (0)