5/6 logical operator help needed


#1

This is my code and wondering what is wrong with it please :

var user = prompt("You are about to take a penalty against Shay Given. Do you SMASH the ball, use PRECISION or do you CHIP the ball through the middle?").toUpperCase();

switch (user) {
case "CHIP":
var outcome = prompt("The ball is saved by Shay Given. Do you react by telling your TEAMMATES not to give up?").toUpperCase();
var effect = prompt("Are you still confident after your miss or has it affected you?").toUpperCase();
var
if(outcome === "yes" || effect === "yes") {

    console.log("Very good choice. The game is still there to be won.");

}
else {
console.log("It is not good to give up like that even though it is difficult not to");
}

    break;

case "SMASH":
    var head = prompt("The ball smashes into the crossbar. Do you react by trying to HEAD").toUpperCase();
    var smash = prompt("He saves again do you try to smash it in?").toUpperCase();
    if(head === "yes" && SMASH ==="yes") {
    console.log("Shay Given saves. He is too good and has quick reflexes to save most rebounds.");
    }

else{ 

    console.log("It does not go in then");
    break;

case "PRECISION":
    console.log("It goes in, the most precise shots are near impossible to save");     
    break;

    default:
    cosnole.log("Hmm that choice is not part of the options, go back and try and pick the options given");

};


#2

Some reading to help you get a response:
http://www.catb.org/esr/faqs/smart-questions.html#urgent
http://www.catb.org/esr/faqs/smart-questions.html#code


#3

i am sorry ionatan did not intend to come across as selfish


#6

Well, you know, more like lazy. Selfish would be to post a great question that everyone throws themselves over!

It's never too late to edit that post and make it approachable!


#7

ok i beg you i edited the title. Please help me lol.


#8

Still no idea how you want this to act differently from what you want. Tell us what we're looking for, don't just dump the code. What are you trying to make happen, and what happens instead.

If you make it easy for others to help you, then people will gladly do so. If you dump your code and say it's "wrong", not so much.


#9

You've spelt console.log wrong for the default.

Not sure if that will fix it but it is something that can cause a problem


#10

I am confused, what exactly do you want me to do? Sorry that i am being slow.


#11

ok thanks benjnev for the help


#12

it is fine now do not worry. I have solved it by myself, thanks anyway