[分享] 不允許在case/default中進行宣告 (no-case-declarations)
(前略)
switch (prop) {
case 'genre':
let genre = genreFormatter(user[prop])
(後略)
}
本章節switch的練習中, 當我在case底下宣告變數時,
ESLint出現了警告
Unexpected lexical declaration in…
These were the top 10 stories published by Code 隨筆放置場 in August of 2019. You can also dive into daily archives for August of 2019 by using the calendar at the top of this page.