interface
![[Typescript] Interface (인터페이스)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbqjNDq%2FbtqDH09fUjB%2FXPwYRirhWRGkZY9Ssotyx1%2Fimg.png)
[Typescript] Interface (인터페이스)
기본적인 사용법 interface Person { name: string; age: number; } const person: Person = { name: 'Mark', age: 35 }; function hello(p: Person): void { console.log(`안녕하세요 ${p.name}`); } optinal property 1 // 이렇게 하면 age는 있어도 되고 없어도 된다. interface Person { name: string; age?: number; } function hello(person: Person): void { console.log(`안녕하세요! ${person.name}입니다.`); } const p1: Person = { name: 'Mark', age: 35..