Getting Syntax errors


#1

Keep getting syntax errors, not sure what I have missed....

// Check if the user is ready to play!
confirm("are you ready to play?");
var age = prompt("What's your age");
if(age < 13)
{
console.log = confirm("Well.. you're allowed to play but it is not our fault if your soul burns in ■■■■ for all eternity")
} else
{
console.log = confirm("Good luck! Hopefully no demons will swallow your soul!")
}
{
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
}


#2

Can you please provide or post the specific error?


#3

why are you trying to confirm nearly everything?

just do console.log("Well.. you're allowed to play but it is not our fault if your soul burns in ■■■■ for all eternity");
} else {

this doesn't need to be inside { } just put
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
by itself.

My solution for reference:


// 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 can play but we take no responsibility")
}

else
{
console.log("Play on!")
}

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


#4

Still getting an error: TypeError: console.log is not a function. Your solution also gave me the same error.

As for why the confirms, tbh I just wanted to make more boxes appear.

// Check if the user is ready to play!
confirm("are you ready to play?");
var age = prompt("What's your age");
if(age < 13)
{
console.log = confirm("Well.. you're allowed to play but it is not our fault if your soul burns in ■■■■ for all eternity")
} else
{
console.log = confirm("Good luck! Hopefully no demons will swallow your soul!")
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.");


#5

Not sure why,

This is a jsbin of your code that I fixed and that seems to run fine?

http://jsbin.com/keqokuguvi/edit?html,js,console

if it still wont work after that refresh the browser and try again


#6

It didn't work at first, so I refreshed the browser as you suggested which fixed it. Strange little glitch..... Thank you for your help!