1
所以我有一個用於/ in循環來變換對象爲對象的數組中的一個陣營預輸入組件使用:如何將其重構爲ES6?
const languageOptions = []
for (const language in i18n.store.data[i18n.language].translation.languages) {
languageOptions.push({
id: language,
label: i18n.store.data[i18n.language].translation.languages[language],
})
}
不過,我得到一個eslint錯誤:Using 'ForInStatement' is not allowed (no-restricted-syntax)
我如何預計現在會進行這種轉變?