Syntax error?


#1

var answer = prompt("What's your favorite sport?");

switch(answer) {
case 'basketball':
console.log("me too");
break;
case 'baseball':
console.log("ew why?");
break;
case 'volleyball':
console.log("i like that sport");
break;
default:
console.log("not familiar with that one :/");
}

}

Not sure what's wrong with my syntax?


#2

Nevermind! I had a extra bracket :frowning:


#3

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