Conversation
Deploying utcode-learn with
|
| Latest commit: |
1998787
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://83228af3.utcode-learn.pages.dev |
| Branch Preview URL: | https://rewrite-typescript.utcode-learn.pages.dev |
| | 引数の型 | `T` が `U` の部分型 | `(x: U) => R` が `(x: T) => R` の部分型 | | ||
| | 戻り値の型 | `T` が `U` の部分型 | `() => T` が `() => U` の部分型 | | ||
|
|
||
| 戻り値の型については自然に理解できますが、引数の数や引数の型については直感に反するかもしれません。このような関係になっているのは、関数が受け取る引数が少なかったり、より一般的な型であったりする場合、その関数はより多くの状況で安全に使用できるためです。 |
There was a problem hiding this comment.
型の互換性は難しいですね. 共変と反変を理解していないからか. https://www.typescriptlang.org/docs/handbook/type-compatibility.html
|
|
||
| **問題1**: `string & number`型は何型と等しいでしょうか。 | ||
|
|
||
| **問題2**: 次のように定義される型`T`に対して使用可能なプロパティは何でしょうか。 |
There was a problem hiding this comment.
使用可能の意味がはっきりしていない気がしました。
- 型絞り込み(type narrowing)なしで直接アクセス可能という意味なのか
- 何らかの方法で使用可能という意味なのか
type narrowingがないときになどあった方が明確かと思いました。
chvmvd
left a comment
There was a problem hiding this comment.
難易度の高い内容も増えているので、DocusaurusのAdmonitionsなどの機能を使って、もう少し初めて学習する際の難易度を下げられるといいかなと思います。特に集合の考え方に日頃から慣れ親しんでいないとかなり認知負荷が高い箇所が多いように思います。
| return item.price * quantity; | ||
| } | ||
|
|
||
| const book = new Book("TypeScript 入門", 2500, "山田 太郎"); |
There was a problem hiding this comment.
一般的には、和文文字と欧文文字間には半角スペースを入れないことの方が多いように思います。
cf. https://ndlsearch.ndl.go.jp/books/R100000002-I032089505 https://ndlsearch.ndl.go.jp/search?cs=bib&keyword=TypeScript+%E5%85%A5%E9%96%80
There was a problem hiding this comment.
Pull Request Overview
This PR restructures and expands the TypeScript documentation, converting it from an exercise-based format to a more comprehensive tutorial with embedded practice problems. The changes improve pedagogical flow by integrating examples and exercises directly into each section.
- Reorganizes content structure by promoting subsections to main sections and integrating exercises inline
- Adds new practice problems with detailed answers throughout the document
- Expands explanations on type relationships, subtyping, and generics with concrete examples
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
補足ですが、特にクラスや関数型の部分型の関係などについては、内容がかなり高度なので削除を検討しても良いように思います。 |
| こういった言語機能は他の多くのプログラミング言語でも用意されており、[ジェネリクス](https://www.typescriptlang.org/docs/handbook/2/generics.html)と呼ばれます。 | ||
|
|
||
| `type`宣言でも型パラメータを利用できます。 | ||
| `type`やクラスでも型パラメータを利用できます。 |
There was a problem hiding this comment.
type=>type宣言?
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| こういった言語機能は他の多くのプログラミング言語でも用意されており、[ジェネリクス](https://www.typescriptlang.org/docs/handbook/2/generics.html)と呼ばれます。 | ||
|
|
||
| `type`宣言でも型パラメータを利用できます。 | ||
| `type`やクラスでも型パラメータを利用できます。 |
There was a problem hiding this comment.
No description provided.