// ⭐️ anonymous
// ╭──────── anonymous ────────╮
function greet(person: { name: string; age: number }) {
return "Hello " + person.name;
}
// ⭐️ interface
interface Person {
name: string;
age : number;
}
// ⭐️ type alias
type Person = {
name: string;
age : number;
};
// test run
function greet(person: Person) {
return "Hello " + person.name;
}