Skip to content

Commit d2464c1

Browse files
Merge pull request #355 from ut-code/fix-typescript-answer
練習問題の解答の誤改行を修正
2 parents 3bd9f44 + 258c759 commit d2464c1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/4-advanced/03-typescript/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,12 @@ Vite は、標準で TypeScript のトランスパイラが内蔵されていま
411411

412412
もしこのコードが通る場合、実際に渡された `{name: "Tanaka", math: 100}` には存在しないはずの `science` プロパティにアクセスできてしまうことになります。このようなことを防ぐために、引数の型が小さい集合になればなるほど、関数の型は大きな集合になる必要があります。
413413

414-
4. ```typescript
415-
function apply<T, U>(f: (x: T) => U, x: T): U {
416-
return f(x);
417-
}
414+
4. 以下のコード
415+
416+
```typescript
417+
function apply<T, U>(f: (x: T) => U, x: T): U {
418+
return f(x);
419+
}
418420
```
419421

420422
<ViewSource url={import.meta.url} path="_samples/apply" noCodeSandbox />

0 commit comments

Comments
 (0)