Created
March 4, 2017 21:12
-
-
Save joanllenas/13b964c3f636d8578365729a8ddccacd to your computer and use it in GitHub Desktop.
TS Type inference 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myBool = false; // Inferred boolean type | |
myBool = 1; // Error: Type '1' is not assignable to type 'boolean'. | |
let myBool2 = true; | |
myBool2 + 5 // Error: Operator '+' cannot be applied to types 'true' and '5'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment