- x = y is assignation (i.e. give variable X value Y)
- x === y is strict equality. (is x equal to y) WITHOUT changing primitive type.
In your example you’re assigning values, not testing equality. That’s the source of your problems.
Also, your “if” statement is not truly working, since you’re also making an assignation, not an equality test.