FrontEnd/TypeScript
-
Modern JavaScript TypeScriptFrontEnd/TypeScript 2023. 3. 11. 17:46
Typescript superset 1. TypeScript 배경 JavaScript 태생적 한계 : Prototype-based Object Oriented Language, Scope/This, 동적타입언어 TypeScript는 Transpiler를 사용하지 않아도(Babel) ES6기능을 자바스크립트 엔진(브라우저/Node.js)에서 사용 가능 2. TypeScript 장점 정적타입 : 명시적인 설정은 코드 가독성을 높여 디버깅이 쉬워짐 //Parameter에 타입을 정의 function sum(a: number, b: number) { return a + b; } sum('x', 'y'); // error TS2345: Argument of type '"x"' is not assignable to..