Unexpected token else


#1

says unexpected token else.can some one help me please?

var user=prompt("who are u?").toLowerCase();
switch(user)
{
    case 'rowan':
        var a=prompt("are u sure");
        if(user=="rowan"&&a=="yes");
        {
        console.log("you are hacker");
        }
        else
        {console.log("you are nog");
        }
        
        break;
    case 'birat':
        var b=prompt("are u sure");
        if(user=="birat"||b=="yes")
        {
            
        console.log("birat");
        }
        else
        {
            console.log("bad");
        }
        
        
        break;
    case 'rosjan':
        var c=prompt("are u sure");
        if(user=="rosjan"&&c=="no")
        {
        console.log("roshan");
        }
        else
        {
            console.log("sqsqs");
        }
        break;
    default:
    console.log("invalid");
    break;
}

#2

@megacoder17705,
A semi-colon-; is an End-of-Statement indicator.

If you use the semi-colon-; directly after an IF condition
like

if (user=="rowan"&&a=="yes");

the corresponding IF code-block will NOT be seen as
being associated with this IF statement
AND
an ELSE statement will NOT be expected by the Javascript Interpreter.


#3

thanks for the help.lol what was i thinking while i was coding hehe