- 기명 함수와 익명 함수
- 느슨한 타입 언어 (loosely typed language)
- 추론된 타입(inferred type) 지정
function-type-skip.ts
function max(x: number, y: number):number {}
function pow(x: number, y: number = 2): number {}
function concat(...restParameter) {}
function concat(...restParameter: string[]) {}
function sum(a: numbber, b?: number): number {}
function add(a: string, b: string) : string;
function add(a: number, b: number) : number;
function add(a: any, b: any) : any {
return a + b;
}
(function(){})()
(() => {})()
arrow-function-with-filter.ts
arrow-function-with-reduce.ts
arrow-function-this.ts
- 객체 리터럴 타입은 인터페이스를 이용해 정의
arrow-function-this2.ts
let myConcat = function (str1: string, str2: string): string { return str1 + str2; };
let myConcat:(str1: string, str2: string) => string = (str1, str2) { return str1 + str2; };
callback-function-step1.ts
callback-function-step2.ts