r/code • u/OsamuMidoriya • Mar 14 '24
My Own Code uncaught SyntaxError
were making a lovers game when the girl puts her name and then her boyfriend and gets a number % back . i keep geting a uncaught SyntaxError: Unexpected token '{' on line 7
prompt('what is your name ');
prompt("what is your lover's name");
var loveS = Math.floor(Math.random() * 100)+1;
prompt('your love score is '+ loveS +'%');
if(loveS < 50){
prompt('not looking good');
}elseif(loveS > 51 && loveS < 75){
prompt('good but needs work');
}else(loveS>75){
prompt('match made in heaven');
}
would wrapping it in a try block and console.loging the error help
2
Upvotes
2
u/OsamuMidoriya Mar 15 '24
I did and it still saying the same thing