5. Logical Operators - Help with Code/ Syntax Error!


Help! Losing sleep :frowning:


Code is producing a Syntax Error:
"SyntaxError: missing ( before condition"

var user = prompt("Are you prepared for the journey that lies ahead?").toUpperCase();

var strength = prompt("On a scale from 1-5 how much strength do you possess?").toUpperCase();

var magic = prompt("On a scale from 1-5 how much magic do you possess?").toUpperCase();

    case 'YES':
        if(strength<=3 && magic<=3){
        console.log("I'm afraid you are too weak to survive this realm, remain home and continue training with your mother!");
        if else(strength>=4 || magic>=4){
        console.log("You are ready, but expect to rely heavily on your stronger hand of two!");
        console.log("You are more than prepared for this adventure, bring both of thy talents!");
    case 'NO': 
        console.log("I Could smell the cowardice upon you!");
    case 'MAYBE':
        console.log("I Have faith in you!");
        console.log("Choose again, the universe doesn't have time for intermediates!");



It should be else if and not if else.

I hope this helps! :wink:


Dude you rock!!! It worked like a charm. Thank you!


You're welcome man!

Have fun coding! :smile:


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