I was reviewing the code for an angularjs factory to better understand how it works. The code contains an if statement that I don\'t fully understand.
if
I
Meanwhile, ^ is the bitwise XOR operator.
^
When dealing with numbers smaller than 2, ^ will work like a boolean OR (||) if you consider 0 = false and 1 = true.
||
0
false
1
true