[Typescript] 좀 더 알아보기(Type Assertion, Index Signature)
1. Type Assertion - 타입스크립트가 추론하지 못하는 타입을 as keyword를 통해 명시해주는 것 - Type casting: 데이터의 타입을 변환 - Type assertion: 데이터의 타입을 명시 Type Assertion의 두 가지 형태 1. As let someValue: unknown = 'this is a string'; let strLength: number = (someValue as string).length; 2. Angle Bracket let someValue: unknown = "this is a string"; let strLength: number = (someValue).length; - JSX에서는 꺾쇠괄호를 통한 Type Assertion은 태그와 혼동되..