Hi, In this question where I am trying to make a one question quiz, it seems as though the variable which is pegged to the input from the prompt is not changing when i re run the script. I have input many different answers to change the variable ‘input1’ trying to recieve the response for an incorrect answer but i am still recieving the CORRECT! alert. any help is appreciated.
hey I have this problem on trading view can you help me ?
Add to Chart operation failed, reason: line 13: syntax error at input ‘long’](https://www.tradingview.com/chart/DuRZKEYa/#)
Hi @StorDreng!
You have an error in your condition. It should be if (answer1 === input1)
=== or == are used when you want to check if variables are equal
while you have if (answer1 = input1)
= is an assignment operator. It always returns true. That’s why you always get the “CORRECT!” alert.
1 Like
Small note. = does not always return true. In your particular case it evaluates to true. But = returns the value that was assigned to a variable (in js).