인터페이스
-
typescript InterfaceProgramming/JavaScript & TypeScript 2022. 2. 18. 14:23
01. Wath art Interfaces 어떤 type을 만들어 내는 방식 예전에는 내부적으로 숨겨져있고, 외부적으로 드러나는 호출 방식 내부적인것과 관계없이 외부적으로 들어나는 객체의 사용방식 //interface가 없으면 function hello2(person:{name:string, age:number}): void{ console.log(`hi my name ${person.name}, age is ${person.age} `); } //interface 사용하면... interface Person1 { name:string, age:number } function hello1(person:Person1): void{ console.log(`hi my name ${person.name}, ag..