Unexpected token 5/6 (Code your own adventure)


#1

Please help! what's wrong here :frowning:

var jobseeker = prompt("What job you preffer Contractual,Permanent or temporary?").toUpperCase();

switch(jobseeker) {
case 'Permanent':
var morningShift = prompt("Are you willing to take morning shift as permanent staff").toUpperCase();
var eveningShift = prompt("Are you willing to take evening shift as permanent staff").toUpperCase();
if(morningShift == Yes && eveningShift == Yes){
console.log("Welcome aboard you are hired");
}esle{
console.log("Sorry! we will let you know);
}
break;
case 'Contractual':
var monthly = prompt("Are you willing to take this position on monthly contract renewal?").toUpperCase();
var yearly = prompt("Are you willing to take this position on yearly contract renewal?").toUpperCase();
if(monthly == Yes || yearly == Yes){
console.log("Welcome aboard you are hired");
}esle{
console.log("Sorry! we will let you know);
}
break;
case 'temporary':
console.log("Welcome your stay here will depend upon your performance");
break;
default:
console.log("I don't understand you!");
}


#2

java script language course it is


#3

What error are you getting? What is your code not doing correctly?


#4

You're writing your cases wrongly. If you defined that all the user inputs be converted to upper case, you should be writing them in the same way.

case 'PERMANENT':
var morningShift = prompt("Are you willing to take morning shift as permanent staff").toUpperCase();
var eveningShift = prompt("Are you willing to take evening shift as permanent staff").toUpperCase();
if(morningShift === "YES" && eveningShift === "YES"){
console.log("Welcome aboard you are hired");
}esle{
console.log("Sorry! we will let you know);
}
break;

And make sure to use the correct equal operator.

Read my more detailed answers to similar questions here:

And here: