Skip to content

Instantly share code, notes, and snippets.

@DaneSirois
Created February 27, 2019 19:11
Show Gist options
  • Save DaneSirois/23b1d844277dfefb841a6dc304132fca to your computer and use it in GitHub Desktop.
Save DaneSirois/23b1d844277dfefb841a6dc304132fca to your computer and use it in GitHub Desktop.
TypeScript - implicit variable typing
let myString = 'hello world'; // implicitly types variable as type 'string'
myString = 52;
//$ error: Type '52' is not assignable to type 'string'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment