Which Syntax am I doing wrong?


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.


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");

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");

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");

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


Hi this line

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

you have one unclose (


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


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