0

I need a breakdown in laymans terms as to where I am going wrong with getting my else statement to work. I thought I had figured it out but don't understand something as I keep running into this issue. Thanks

      if (country === "Brazil" || "Portugal") {
        alert("You speak Portuguese");
      } else {
        alert("You don't speak Portuguese");
      }
  • 3
    `if (country === "Brazil" || country === "Portugal") {...}` – justDan Oct 28 '20 at 16:16
  • Thank you! What if I am trying to get it to still say you speak Portuguese when they mispell brazil to brasil or portugel? – Stephanie Brandon Oct 28 '20 at 16:20
  • There's a few ways you could do that. In you case, the easiest would probably be just to add additional checks to the `if` statement: https://jsfiddle.net/0cqbt7nf/1/ – justDan Oct 28 '20 at 16:26

1 Answers1

1

You need to do the following:

if (country === "Brazil" || country === "Portugal") {
  alert("You speak Portuguese");
} else {
  alert("You don't speak Portuguese");
}

Let me know if it helps.

ralphwayTOW
  • 108
  • 1
  • 8
  • Thank you that does help! hank you! What if I am trying to get it to still say you speak Portuguese when they misspell brazil to brasil or portugel? – Stephanie Brandon Oct 28 '20 at 16:24