SyntaxError: Illegal return statement?


#1

I don't know what this means or what to change?

var answer = prompt("what's your name?").toLowerCase();
var user = answer

switch(user) {
case 'connor':
console.log("Hey Connor!")
break;
case 'greg':
console.log("Hey Greg!")
break;
case 'brittany':
console.log("Hey Britany!")
break;
case 'cailin':
console.log("I've made a huge mistake!")
break;
default:
console.log("I don't know you!");
}
if('connor' || 'greg' == true) {
return "Hello"}
else{
return "hi there!";
}
if('brittany' && 'cailin' == true) {
return "Sup"}
else{
return "yellow"
}


#2

@chenry831
Put semicolon after declaring your variable, after returning a string and log strings in the console like this;

var answer = prompt("what's your name?").toLowerCase();
var user = answer;

switch(user) {
case 'connor':
console.log("Hey Connor!");
break;
case 'greg':
console.log("Hey Greg!");
break;
case 'brittany':
console.log("Hey Britany!");
break;
case 'cailin':
console.log("I've made a huge mistake!");
break;
default:
console.log("I don't know you!");
}
if('connor' || 'greg' == true) {
return "Hello";}
else{
return "hi there!";
}
if('brittany' && 'cailin' == true) {
return "Sup";}
else{
return "yellow";
}