Reputation: 19
i'm new to coding, and i cant figure out what i am doing wrong. every time i try to write an if/ else, it works up to the point that the statement is, and then it wont work.
this is what i wrote:
alert("welcome to chloe's quiz show!")
var name = prompt("contestant, what is your name?")
var help = prompt("is this your first time playing? type 'yes' or 'no'.")
if (help === yes){
alert("the game is easy! all you have to do is type the letter that corresponds with the correct answer. then press 'ok'.")
confirm("lets get started!")
}
else{
confirm("lets get started then!")
}
Upvotes: 1
Views: 164
Reputation: 784888
Change this line:
if (help === yes)
to this:
if (help == "yes")
Since yes
is not a variable.
Upvotes: 6