TypeScript基本から応用まで 100本ノック
サンプル
基本と型推論 - 問題 3