Skip to content

Instantly share code, notes, and snippets.

@jasonleehodges
Last active February 13, 2022 17:46
Show Gist options
  • Save jasonleehodges/ff7b7d71473d3cbb2496523211bd5d14 to your computer and use it in GitHub Desktop.
Save jasonleehodges/ff7b7d71473d3cbb2496523211bd5d14 to your computer and use it in GitHub Desktop.
TS Return Type Error Message
function add(a: number, b: number): number {
/*
Let's assume there is a bunch of logic here which makes
the error message in this function less obvious
*/
return 'a' + 'b';
}
Type 'string' is not assignable to type 'number'. ts(2322)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment