Prompt is not a function error is persistent


#1


Exercise: https://www.codecademy.com/en/courses/javascript-beginner-en-x9DnD/0/5?curriculum_id=506324b3a7dffd00020bf661#

I have spent a long time trying to figure this out, including a lot of searching. No matter what I do (refresh browser, use different browser, rewrite code), I continually get the error: TypeError: prompt is not a function

I have even mimicked successful options proposed by others (same as my original answer, unfortunately). I have no idea what I'm doing wrong. I'm in Chrome, but have tried it in Firefox too. I even skipped an exercise to make sure that wasn't it, and then went back and rewrote everything. Any help appreciated.


// Check if the user is ready to play!
confirm("I am ready to play")
var prompt = ("what's your age?")

if("age" < 13)
{
    console.log("You play at your own risk");
}
else
{
    console.log("Play on, playa.");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");

console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");

var userAnswer = prompt("Do you want to race Bieber on stage?");
if(userAnswer === "yes")
{
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace");
}
else
{
    console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}


#2

You put var prompt = ("what's your age");. It should be var age = prompt("what's your age");. Prompt is a function, not a variable.