Last active
February 13, 2022 17:46
-
-
Save jasonleehodges/ff7b7d71473d3cbb2496523211bd5d14 to your computer and use it in GitHub Desktop.
TS Return Type Error Message
This file contains hidden or 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
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'; | |
} |
This file contains hidden or 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
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