To fix this:
if (userInput = mag.randomMagnifier())
in
if (userInput == mag.randomMagnifier())
Here you assign a value in the if , which is not true. You must check the condition, to check the condition u you need to use "==" .
The if returns boolean values ββand because you assign a value here, it gives an error.
source share