Type

    [TS] Type

    타입스크립트에서 타입을 설정하는 방법은 다양합니다. 기본적인 부분만 정리해보려 합니다. 참고 할만한 핸드북 링크 - https://joshua1988.github.io/ts/ 1. 기본 타입 자바스크립드와 다르게 타입스크립트는 변수, 함수를 선언할 때, 타입을 꼭 설정해 주어야 합니다. 1. number const num: number = 3; 2. string const str: string = 'Hello World'; 3. boolean const bool: boolean = false; 4. void function World(): void { console.log('hello world'); return; } 함수가 어떠한 것도 리턴하지 않을 때 사용합니다. (생략 가능) 5. never fun..