Problem in 3/7


#1

This is my code. However, "Oops, try again. Make sure your string is correct and is between quotation marks!" appeared. Please help. I've been stuck on this for a long time.

// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age");
if (age<13){
console.log("You are allowed to play,but I will take no responsibility.");
} else {
console.log("Welcome and keep playing.");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");

Thanks in advance. :smile:


#2

I tried your code using a windows 8.1 IE11 environment and got a pass....
Maybe...

reset of session

under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum from Tony de araujo
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#3

Thank you.

It worked. :smile:


#4

I have tried in all my browsers, no successful :cry:

Do you have some another tip to try?

-- Chrome 45.0.2454.101m
-----Fox 41.0.1
-- IE11 .0.10240.16431
-----EDGE 20.10240.16384.0 ))


#5

Present your code
and mention
the section title
and the Oops message


#6

Hi Leonhard.
I believe that the exercise is missing some "condition" before last "console.log".
But I'm learning, have no idea of as I can finish it :cry:

JS: Code your own adventure (3/7)

===============================
confirm("Are you ready to play?");
var age = prompt("What's your age");

if(age < 13)
{console.log("It's not good but we can turn it easy for you. Ok, let's start!")}
else
{console.log("Excelent! Let's play!")}

Missing something

{console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'"}

===============================
MESSAGE = Oops, try again. There was a problem with your syntax._


#7

I saw here that more students are having problems in step 5/7.

It's disturbing me, a good website without prompt support :cry:


#8

First of all, you need semi colons after your console.logs, second of all that last console.log doesn't need any brackets, nor a function. The last console.log is supposed to be outside of the if/else statement.


#9

UOW!!!!!!

Thanks guy!

Added semicolon and eliminated brackets in the last console.log...
THANK YOU! (RAGING and LEONHARD)


#10

It's my code now

===============================
confirm("Are you ready to play?");
var age = prompt("What's your age");

if(age < 13)
{console.log("It's not good but we can turn it easy for you. Ok, let's start!")}
else
{console.log("Excelent! Let's play!")} > ; <

x [ x console.log("You are at a Justin Bieber concert,
and you hear this lyric 'Lace my shoes off, start racing.'") x ] x

===============================


#11

It also worked for me thanks


#12

// Check if the user is ready to play!
confirm("Are you ready to begin")
var age = prompt("What's your age");

if(age is less than 13)
{
console.log(you are allowed to play but I take no responsibility);
}
else(you are welcome to play)
{
//introduction//
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")


can you show me what I did wrong in this, I keep getting Syntax Error


#13

Have look at the comparison operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators