Skip to content

Instantly share code, notes, and snippets.

@methodbox
Last active July 9, 2019 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save methodbox/41c4f969d37e20ad50e3ed9bb20de405 to your computer and use it in GitHub Desktop.
Save methodbox/41c4f969d37e20ad50e3ed9bb20de405 to your computer and use it in GitHub Desktop.
TypeScript example for tooling
let myNumber: number = 10;
let myString: string = 'this is a string';
const badMath = (x: number, y: number) => {
return x * y;
}
badMath(myNumber, myString) /**
* error TS2345: Argument of type 'string'
* is not assignable to parameter of type 'number'.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment