Which value is better to use? Boolean true or Integer 1?

前端 未结 3 1570
猫巷女王i
猫巷女王i 2021-02-05 15:15

Does it make any sense or not?

3条回答
  •  难免孤独
    2021-02-05 15:45

    I recommend using true if your type is logically a boolean. This will be far more clear in terms of intent, which makes your code more maintainable.

提交回复
热议问题