mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-22 13:00:56 -04:00
fix(curriculum): mention browser console (#55881)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@ fetch("sample-url-goes-here")
|
||||
.then((res) => res)
|
||||
```
|
||||
|
||||
Chain the `.then()` method to your `fetch` call. Inside the `.then()` method, add a callback function with `res` as a parameter, then log the `res` to the console so you can see the `Response` object. Open your console and expand the `Response` object to see what it contains.
|
||||
Chain the `.then()` method to your `fetch` call. Inside the `.then()` method, add a callback function with `res` as a parameter, then log the `res` to the console so you can see the `Response` object. Open your browser console and expand the `Response` object to see what it contains.
|
||||
|
||||
Again, don't terminate the code with a semicolon yet.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ dashedName: step-4
|
||||
|
||||
# --description--
|
||||
|
||||
The data you get from a `GET` request is not usable at first. To make the data usable, you can use the `.json()` method on the `Response` object to parse it into JSON. If you expand the `Prototype` of the `Response` object in the console, you will see the `.json()` method there.
|
||||
The data you get from a `GET` request is not usable at first. To make the data usable, you can use the `.json()` method on the `Response` object to parse it into JSON. If you expand the `Prototype` of the `Response` object in the browser console, you will see the `.json()` method there.
|
||||
|
||||
Remove `console.log(res)` and implicitly return `res.json()` instead.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user