Created
September 19, 2024 15:36
-
-
Save dontpaniclabsgists/df3d75290a6eeba716fe7b6887a24550 to your computer and use it in GitHub Desktop.
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 greet(name: string): string { | |
return "Hello, " + name; | |
} | |
console.log(greet("Alice")); // Output: Hello, Alice | |
console.log(greet(123)); // Error: Argument of type 'number' is not assignable to parameter of type 'string'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment