ESLint error no-unneeded-ternary

前端 未结 2 1372
悲哀的现实
悲哀的现实 2021-02-11 20:25

ESLint is telling me this error message inside my JS module: error no-unneeded-ternary Unnecessary use of conditional expression for default assignment

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-11 21:11

    You don't need a ternary when a simple val || defaultVal will do.

提交回复
热议问题