Fix typo in the spec

This commit is contained in:
Mohamed Hegazy 2015-12-02 22:05:11 -08:00
parent b14b7e9172
commit 4137a103d8
3 changed files with 1 additions and 1 deletions

View file

@ -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`: