8. All on your own


All on your own

syntax error. don't know where I did it wrong?

var type = prompt("What's your favorite hamster type?);

switch(type) {
    case 'Robo' :
        console.log("That's my favorite too!");
    case 'Dwarf' :
        console.log("That's adorable!");
    case 'Panada bear' :
        console.log("lovely little creature!");
    default :
        console.log("That's not hamster!");


You forgot to enclose (with quotes) your prompt's string.


Thanks for the helping!


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