mirror of
https://gitee.com/openharmony/third_party_typescript
synced 2025-02-02 17:32:58 +00: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