6. Practice with switch | What am I supposed to do?


#1

Hi, I keep getting the error this error... | Oops, try again. Did you remember to put in your default block?

What am I supposed to do here, I am very confused and would like a detailed answer so I can learn and find out what to do next time.

Code:


var candy = prompt("What's your favorite candy?","Type your favorite candy here.");

switch(candy) {
  case 'licorice':
    console.log("Gross!");
    break;
  case 'gum':
    console.log("I like gum!");
    break;
  case 'beets':
    console.log("...is that even a candy?");
    break;
  // Add your code here!
  defualt:
    console.log("I don't know that candy!");
}


#2

In this line
Misppelling there!


#3

Spelling is important. It should default.


#4

Thanks, I'm such an idiot...


#5

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