Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed two typo errors in part-9-c #3843 #3846

Open
wants to merge 1 commit into
base: source
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/content/9/en/part9c.md
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ The response is what we expect it to be:

So far we have not discussed anything about the types of the route handler parameters.

If we hover eg. the parameter _res_, we notice it has the followng type:
If we hover, for example, over the parameter res, we notice it has the following type:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If we hover, for example, over the parameter res, we notice it has the following type:
If we hover, for example, over the parameter _res_, we notice it has the following type:


```js
Response<any, Record<string, any>, number>
Expand All @@ -835,7 +835,7 @@ export interface Response<

The first type parameter is the most interesting for us, it corresponds <i>the response body</i> and has a default value _any_. So that is why TypeScript compiler accepts any type of response and we get no help to get the response right.

We could and propably should give a proper type as the type variable. In our case it is an array of diary entries:
We could and probably should give a proper type as the type variable. In our case it is an array of diary entries:

```js
import { Response } from 'express'
Expand Down