Which Syntax am I doing wrong?


#1

Aug 26 - I am a newbie on coding and have come to this site to learn. I have been stuck on this for the last week. Any help is much appreciated.

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

SyntaxError: missing ) after argument list


var user = prompt("You see a lady wanting to cross the street?, do you help her?","Type your answer here").toUpperCase();

switch(user) {
case 'Yes':
    var brave = prompt("Are you brave enough to ask?").toUpperCase();
    var strong = prompt("Are you strong enough to help(YES or No)?").toUpperCase();
    if(brave === 'YES' && strong === 'YES'){ 
console.log("I will help you cross the street");
} else {
    console.log("I can't help");
}
break;

case 'No':
    var weak = prompt("Do you feel weak today(YES or NO)?").toUpperCase();
    var sick = prompt(("Are you sick today?").toUpperCase();
    if(weak === 'YES' || sick === 'YES') {
console.log("Sorry, I'm not feeling well now!");
} else {
    console.log("Going home sick");
    };
break;

case 'Maybe':
    var scared = prompt("Are you scared to help(YES or NO)?").toUpperCase();
    var time = prompt("Do you not have time to help?").toUpperCase();
    if(scared === 'YES' && time === 'YES') {
console.log("Sorry I can't help as I am too scared");
} else {
    console.log("Why is this not working");
}
break;

default: 
console.log("Sorry, I don't understand you, you will have to speak a little louder");
}


#2

Hi this line

var sick = prompt(("Are you sick today?").toUpperCase();

you have one unclose (


#3

Thank you so much! I was stuck on it for days...


#4

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