checking a variable value using an OR operator

后端 未结 3 1582
野的像风
野的像风 2021-01-11 10:55

So, a junior programmer on my team today wrote the following piece of code:

if(status === (\"incomplete\" || \"unknown\"))

Which is obvious

3条回答
  •  無奈伤痛
    2021-01-11 11:49

    ("incomplete" || "unknown") will return "incomplete" which is than compared to status.

提交回复
热议问题