mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-06 12:32:12 -06:00
Fix typo in the spec
This commit is contained in:
parent
b14b7e9172
commit
4137a103d8
Binary file not shown.
Binary file not shown.
@ -1323,7 +1323,7 @@ x = "hello"; // Ok
|
||||
x = 42; // Ok
|
||||
x = test; // Error, boolean not assignable
|
||||
x = test ? 5 : "five"; // Ok
|
||||
x = test ? 0 : false; // Error, number | boolean not asssignable
|
||||
x = test ? 0 : false; // Error, number | boolean not assignable
|
||||
```
|
||||
|
||||
it is possible to assign 'x' a value of type `string`, `number`, or the union type `string | number`, but not any other type. To access a value in 'x', a type guard can be used to first narrow the type of 'x' to either `string` or `number`:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user