More on control flow in JS


Hi, I don't understand why, even if I type one of the answers included in the cases, the computer always gives me the answer: "What do you mean?" which is the default. I don't find any mistake here.
Any help would be appreciated. Thanks

var weather = prompt ("What would you do in a rainy day?", "Type your ideas here");

switch(answer) {
case 'play tennis':
console.log("I would do the same");
case 'I would be depressed':
console.log("Really? Call me instead!");
case 'sleep':
console.log("Good idea");
console.log("What do you mean?");

More on Control Flow in JS - And

HI you saved the prompt in var weather so you should put weather ..


instead of answer


thank you @wizmarco , this is clear now