[removed] How can I simplify an if-statement with multiple OR conditions?

前端 未结 6 959
半阙折子戏
半阙折子戏 2021-01-16 17:22

Sorry if I\'ve made mistakes writing this post. I\'m new here and I don\'t know how this works, hope I learn quick. I am also new at JavaScript.

So the question is:

6条回答
  •  情歌与酒
    2021-01-16 17:48

    You must do it the second way you mentioned:

    if (codePrompt == codeSwitch ||
    codePrompt == codeSwitchBG || codePrompt == codeBlur || codePrompt == codeShowInfo){};
    

提交回复
热议问题