If statement runs through whether conditions are met or not

后端 未结 4 1220
北海茫月
北海茫月 2021-01-28 17:13

My if statement runs through as if the conditions have been met even when they haven\'t. I have tried moving bits of code about and even rewriting the if statement differently b

4条回答
  •  孤城傲影
    2021-01-28 17:26

    bob == "no", "No", "NO", "nO"
    

    is not doing what you think it is doing. You mean to do:

    bob == "no" ||
    bob == "No" ||
    bob == "NO" ||
    bob == "nO"
    

提交回复
热议问题