Last Updated: February 25, 2016
·
3.753K
· hjwu

The difference between & vs && and | vs ||

之前一直搞錯,以為兩個符號就是判斷兩次。 orz

&& stops if the first operand is false and || stops if the first operand is true, while & and | always evaluate both operands

Reference : & vs && and | vs ||