[TypeScript] Recordや{[key]: string}よりnew Mapを使う理由
Recordや{[key]: string}よりnew Mapを使う理由 const obj: Record = { a: 'a' }; // itemはstringとして推論される、実態はundefined const item = obj.b; // Cannot read properties of undefined (reading 'toUpperCase') item.toUpperCase(); const ho...