TS2 220801 Typescript Handbook Typescript 핸드북 Typescript 핸드북 원시타입 (Primitives) : string, number, boolean Array any 변수의 Type 정의(Annotation) 함수 (Function) Parameter Type 정의 Return 타입 정의 익명 함수 (Anonymous Function) 오브젝트 타입 (Object) Parameter Type 정의 Optional Properties Union Types Union Type 정의 Union Types 사용하기 Type Aliases Interfaces Type Aliases 와 Interface 의 차이? 타입 단언 (Type Assertion) Literal Types null 과 undefined Non-null 단언.. 2022. 8. 1. 2) Typescript - interface Typescript Interface Interface Typescript의 핵심 원리는 그 값이 가지고있는 형태를 중심으로 타입 체크를 한다는 것입니다. 이것은 "duck typing" 이나 "structural subtyping" 이라고 불리웁니다. interface는 이 타입들의 역할을 채우며, 여러분의 코드를 정의하는 강력한 방법입니다. function printing (obj: { label: string }) { console.log(obj.label) } let myObj1 = { size: 10, label: "Size 10 Object" } let myObj2 = { size: 10 } printing(myObj1) printing(myObj2) // Property 'label&.. 2021. 1. 25. 이전 1 다음