타입 정의 방법
·
typescript
anaotation " data-ke-type="html">HTML 삽입미리보기할 수 없는 소스변수를 선언할 때, 타입을 지정하는 방식" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스원시값const stringSample: string = "string"; //변수뒤에 콜론과 타입을 넣는다const numberSample: number = 1;const booleanSample: boolean = true;const nullSample: null = null;const undefinedSample: undefined = undefined;배열const strArr: string[] = []; //대괄호 앞의 타입은 배열요소의 타입이다strArr.push("hello")..
Hyunsoo_Kim
'typescript' 카테고리의 글 목록