Skip to content

Commit

Permalink
Merge pull request #3895 from leburgeon/patch-1
Browse files Browse the repository at this point in the history
Update part9b.md
  • Loading branch information
mluukkai authored Dec 3, 2024
2 parents 32ba1ef + effc61b commit 54c4044
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/9/en/part9b.md
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ app.post('/calculate', (req, res) => {
});
```
Using a type assertion (or quieting an Eslint rule) is always a bit risky thing. It leaves the TypeScript compiler off the hook, the compiler just trusts that we as developers know what we are doing. If the asserted type <i>does not</i> have the right kind of value, the result will be a runtime error, so one must be pretty careful when validating the data if a type assertion is used.
Using a type assertion (or quieting an Eslint rule) is always a bit risky. It leaves the TypeScript compiler off the hook, the compiler just trusts that we as developers know what we are doing. If the asserted type <i>does not</i> have the right kind of value, the result will be a runtime error, so one must be pretty careful when validating the data if a type assertion is used.
In the next chapter, we shall have a look at [type narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html) which will provide a much more safe way of giving a stricter type for data that is coming from an external source.
Expand Down

0 comments on commit 54c4044

Please sign in to comment.