# Object Types

{% hint style="info" %}
objects can be **anonymous**, named by using **interface** or **type**.
{% endhint %}

```typescript
// ⭐️ 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;
}
```
