The code has an assignment operator as the conditional expression for a conditional statement. You may have intended to use an equality or strict equality operator.
To correct this error
Change the assignment operator (=) to the equality operator (==) or the strict equality operator (===).
Move the assignment to immediately precede the conditional statement, and then use the left operand of the assignment operator as the conditional expression.