TypeScriptでの型の指定
型の指定の例
サンプルコード
let name: string = "Mike"; let age: number = "24"; let adult: boolean = true; interface ADRESS { state: string; county: string; city?: string; street: string | null; } let add: ADDRESS = { state: "California", county: "San Diego", street: null } const func = (x: number, y: number): number => { return x + y; }