프로그래밍 언어/TypeScript
-
[Inflean 장기효] 입문강의 -문법 이전 내용-프로그래밍 언어/TypeScript 2023. 7. 13. 14:53
교안 : 타입스크립트 핸드북 (joshua1988.github.io/ts/) 타입스크립트란? 자바스크립트에 타입을 부여한 언어이다 자바스크립트와는 다르게 브라우저에서 실행하기 위해 파일을 한번 변환해주는 과정(컴파일)이 필요하다 타입스크립트는 왜 써야하는가? JS를 써서 비동기 처리를 할 때 [object Object] 이런 데이터들을 몇번 보았는데 이러한 부분을 타입스크립트를 쓴다면 좀 더 명확하게 연결 할 수 있다. 또한 오탈자로 인해서 정보를 불러오지 못하는 경우(undefined) 에러로 연결 될 수 있다 이런 부분도 타입스크립트를 통해 보완 할 수 있다. 코드 상으로 알 수 없는 데이터의 모습을 파악 할 수 있다. (에러의 사전 방지) 브라우저를 실행해서 data 값을 보고 그것을 기반으로해서 ..