TypeScriptにおける分割代入を使った引数受け渡し

以下のような関数を考えてみましょう。 interface Student { id: number; name: string; class: string; sex: string; } function matriculation(student: Student) { // ... } この関数を呼び出すには、Studentインターフェースの制約を満たすオブジェクトを渡す必要があります。 interface Student { id: number; name: string; class: string; sex: ...

5月22日 13:53 投稿