Before statement; what is a before statement


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/4?curriculum_id=506324b3a7dffd00020bf661

<In what way does your code behave incorrectly? Include ALL error messages.>
SyntaxError: missing before statement

```

var boss = prompt(“Do you want to raid the pension fund, take over a company, or become a Marine?”).toLowerCase();

switch (boss){
case’raid’:
var stealthy = prompt(“Is your CPA stealthy (Yes or No)?”).toLowerCase();
var ethics = prompt(“Do you have any ethics (Yes or No)?”).toLowerCase();
if(stealthy==‘Yes’&&ethics==‘No’) {
console.log(“GREAT! That is a perfect combination!”);
} else {
console.log(“Sorry, you must have already given up ethics. Maybe another time.”);
}
break;
case’take’:
var identified = prompt(“Have you identified (Yes or No) your target?”).toLowerCase();
var offer = prompt(“Have you made an offer (Yes or No)?”).toLowerCase();
if(identified==‘yes’||offer==‘no’){
console.log(“Good, you have a start.”);

    } else {
      console.log("To take over a company, you have to decide which company and make an offer.");
    }
break;
case'Marine':
    var strong = prompt("Are you strong (Yes or No)?").toLowerCase();
    var blues = prompt("Do you look good in dress blues (Yes or No)?").toLowerCase();
    if(strong=='yes'||blues=='yes') {
        console.log("Sign right here!").toLowerCase();
    } else {
        console.log("Too bad!  You're stuck in this job instead of getting to march in parades.");    
break;
default: 
    console.log("I'm not sure what you are choosing.  Click RUN and select raid the pension fund, take over a company, or become a Marine."); 
}
<do not remove the three backticks above>

#2

@lodum

Do not forget to close curly bracket!


#3

Good eye! Thank you. I still get this error message: SyntaxError: missing before statement. What does this mean?


#4

Hi,
I tried your code and don’t get any error.
One thing though:
Since you put all your prompts toLowerCase();, you will need to make sure that in all your if statements are entirely in lower case.

In your first if statement you had capital letters. This will need to be corrected.


#5

Ah-Ha!! My error with the case – I’ll be more careful, thank you.