Syntax error again. v.v Code your own adventure 2! 5.Operators


#1

Can someone tell me whats wrong in this code? o.o Some sort of a syntax error with those... { , } thingys...
var answer = prompt("Have you served as a knight before? yes/no"){
if (answer = "yes"){
return true;
}
else{
return false;
}
}
Altho i found out that I had been doing my exercise wrong... v.v I still want to know what I did wrong. o.o


#2

I suppose you should try indenting your code properly if you found nothing else wrong.


#3

Whats that? o.o Never heard of such word. o.o


#4

like alignment sorta..


#5

Okey thanks. Didnt know "indenting" could give you an error. =.=


#6

No problem.
I encountered quite a few while taking the Html and Css course so i always make sure I get it right.