这样定义:
const KEY_TO_NAME: Record<string, string> = {
worldwide: 'ww',
nafta: 'NAFTA',
apec: 'APEC',
eea: 'EEA',
};
这样遍历:
for (const [key, name] of Object.entries(KEY_TO_NAME)) {
}
或
Object.entries(KEY_TO_NAME)
.filter(([key]) => ...)
.forEach(([, name]) => ...);


被折叠的 条评论
为什么被折叠?



