Skip to content

Instantly share code, notes, and snippets.

@joanllenas
Created March 4, 2017 21:12
Show Gist options
  • Save joanllenas/13b964c3f636d8578365729a8ddccacd to your computer and use it in GitHub Desktop.
Save joanllenas/13b964c3f636d8578365729a8ddccacd to your computer and use it in GitHub Desktop.
TS Type inference 1
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