Skip to content
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 packages/documentation/copy/en/handbook-v2/Narrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ function isFish(pet: Fish | Bird): pet is Fish {
}
```

`pet is Fish` is our type predicate in this example.
A predicate takes the form `parameterName is Type`, where `parameterName` must be the name of a parameter from the current function signature.
`pet as Fish` is our type predicate in this example.
A predicate takes the form `parameterName as Type`, where `parameterName` must be the name of a parameter from the current function signature.

Any time `isFish` is called with some variable, TypeScript will _narrow_ that variable to that specific type if the original type is compatible.

Expand Down