11 (string型) • mul(a,b) -> 1 (number型) function add (a, b) { return a + b; } function mul (a, b) { return a * b; } const a = 1; const b = “1"; add(a, b); mul(a, b);
b: number): number { return a + b; } function mul(a: number, b: number): number { return a * b; } const a = 1; const b = "1"; console.log(add(a, b)); console.log(mul(a, b));