Which is clearer form: if(!value) or if(flag == value)?

后端 未结 19 2777
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-23 19:07

I understand this is a subjective question, so I apologize if it needs to be closed, but I feel like it comes up often enough for me to wonder if there is a general preferen

19条回答
  •  余生分开走
    2020-12-23 19:54

    I would never use if(value == true), so just for consistency I would also not use if(value != false).

提交回复
热议问题