Javascript If Condition with multiple OR and AND

前端 未结 7 831
谎友^
谎友^ 2020-12-22 07:33

please have a look on my if condition. I am just refreshing my javascript and I am wondering, how I could check, if the inserted variables, are the ones I want to be used.

7条回答
  •  一整个雨季
    2020-12-22 08:04

    I believe it shoud look like:

    if ((choice1=="rock" || choice1=="paper" || choice1=="scissors") && 
        (choice2=="rock" || choice2=="paper" || choice2=="scissors")){...
    

提交回复
热议问题