Created
September 19, 2024 15:38
-
-
Save dontpaniclabsgists/aca6a3537b5bfde8c3953b9f6bfa4ad8 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
interface User { | |
name: string; | |
age: number; | |
} | |
let user: User = { name: "Alice", age: 30 }; | |
function displayUser(user: User): void { | |
console.log(user.name + " is " + user.age + " years old."); | |
} | |
displayUser(user); // Output: Alice is 30 years old. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment