2021-04-19から1日間の記事一覧
配列がRecord型…という思わぬ罠になる時があるので注意. 例 type N2S = Record<number, string>; // No error. Both are valid. const obj: N2S = { 0: "hello" }; const ary: N2S = ["hello"]; // Reasonable const obj1 = obj[0]; const ary1 = ary[0]; 要素へのアクセスに</number,>…