What is wrong with this code!


#1

confirm("I am ready to play!");
var age = prompt("What's your age");
if(age < 13)
{
console.log("You can play, but we take no responsibility!");
}
else
{
console.log("Play on!");
}

I love learning about Javam but this code is making me insane. What is wrong, please tell me! The system says: "SyntaxError: expected expression, got keyword 'else'"


#2

try after refresh your page.

dont worry :slight_smile: the good thing is you'll learn from your mistake.


#3

It didn't help.But the code seems correct, right?


#4

yes, your code is right.couldn't you pass the lesson?


#5

The code is , Right !


#6

No, I'm not able to pass the lesson. Until it happens, my java learning will be on hold.

Hent Outlook til Androidhttps://aka.ms/ghei36


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.