"if" doesn't work while "switch" does

in short:
The == operator compares references not values.

1 Like