Skip to content

Commit

Permalink
Update type-assertion.md
Browse files Browse the repository at this point in the history
  • Loading branch information
basarat authored Jun 29, 2024
1 parent c297e47 commit e31fe92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/types/type-assertion.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ var foo: Foo = {
In some cases you might need to create a temporary variable, but at least you will not be making (possibly false) promises and instead relying on the type inference to do the checking for you.

### Double assertion

> [Pro Video Lesson on Double Assertion](https://www.booleanart.com/course/typescript/double-assertion)
The type assertion, despite being a bit unsafe as we've shown, is not *completely open season*. E.g. the following is a very valid use case (e.g. the user thinks the event passed in will be a more specific case of an event) and the type assertion works as expected:

```ts
Expand Down

0 comments on commit e31fe92

Please sign in to comment.