4. Switch


#1

var user = prompt ("Are you ready?").toLowerCase();

switch(user) {
case 'Yes':
console.log("Let's do it");
break;
case 'No'
console.log("Come back when you will be ready");
break;
case 'Absolutely':
console.log("This waht I want to hear all the time");
break;
default:
console.log("I don't know you");
};

Help me please. I don't know what is wrong. I'm keep getting "There is a problem with your syntax"


#2

On your second case you forgot the ":". Add it and try again.


#3

Omg. such a stupid mistake. Thank you it worked


#4

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