Last active
July 14, 2020 18:59
-
-
Save subwaymatch/1fde33c1d65fca274e538f1bf2fa6919 to your computer and use it in GitHub Desktop.
This file contains 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 addTwoNumbers(num1, num2) { | |
return num1 + num2; | |
} | |
var result = addTwoNumbers('10', 20); | |
console.log("Result: " + result); | |
console.log("Return Type: " + typeof result); | |
// Outputs an error message during compilation | |
// demo.ts(5,28): error TS2345: Argument of type '"10"' 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