Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created September 19, 2024 15:38
Show Gist options
  • Save dontpaniclabsgists/aca6a3537b5bfde8c3953b9f6bfa4ad8 to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/aca6a3537b5bfde8c3953b9f6bfa4ad8 to your computer and use it in GitHub Desktop.
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