4. Switch(Code your Adventure)


#1

var user= prompt("What country do you belong to orginally?").toUpperCase();
switch(user) {
case 'India' :
console.log("Wow I belong there to" ' ' + user);
break;
case 'Finlad' :
console.log("Wow I belong there to" ' ' + user);
break;
case ' USA'
console.log("Wow I belong there to" ' ' + user);
break;
default :
console.log(" Wow I never heard about htsi countjry thoguh I would love to be to" + ' ' user)
break;
}
//It's not working please explain...//


#2

What error does it show? I'm willing to bet it has something to do with there being ''s in between your " and +, but there's no way of knowing unless you post a picture or stacktrace


#3


#4

I figured it out so I don't need any of your solutions I just had to put the colon in front of USA, though anyways thanks, for everyone's time... Thanks a lot.


#5

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