Very novice help request

Hello Codecademy!

Working through Learn JavaScript and am on the Function Expressions page.

Wasn’t 100% understanding it after doing the steps so decided to try replicate with a different goal and add in a flow control to it but it’s not liking my list. Hoping someone might be able to tell me where I’m going wrong.

I think it’s pretty simple to see what result I’m aiming for but please let me know if it doesn’t make sense.

const puppyNeedToUseToilet = function(timeSincePee){
  if (timeSincePee >= 1){
    return 'Yep!'
  } else if {
    (timeSincePee>=2)
    return 'Quickly get him outside!'
   } else if {
    (timesincePee>=3)
    return "He's already peed somewhere in the house Sadge"
   } else { 'Nah you gucci dawg'
}
}
puppyNeedToUseToilet(1)
console.log(puppyNeedToUseToilet)

//WHY DOESN'T THIS WORK

const puppyNeedToUseToilet = function(timeSincePee){
  if (timeSincePee >= 1){
    console.log('Yep!')
  } else if {
    (timeSincePee>=2)
    console.log('Quickly get him outside!')
   } else if {
    (timesincePee>=3)
    console.log("He's already peed somewhere in the house Sadge")
   } else {
     console.log('Nah you gucci dawg')
}
}
puppyNeedToUseToilet(1)
console.log(puppyNeedToUseToilet)

//tried with console.log instead of return and still doesn't work. Don't think I've made an 'else if' control flow correctly.

Thanks everyone =]

@board4440554238 Your opening brackets { in the else if statements are placed incorrectly. Please place your conditional in parentheses before the brackets and then try again. Kindly let me know if this helps!

Hey!

FYI, JavaScript isn’t the same as Java (despite the naming), so I’ve gone ahead and moved this from #get-help:java to #get-help:javascript :slightly_smiling_face:

The code’s problem I see is yes it makes sense in our mind what we mean. But if you run it through the logic of a computer, then the pc makes its own sense against us ;p. If is a little different from a “switch”. If this does not make sense, think as if you are a computer/compiler, and also line by line. So long as you run it through your head, it will make more sense as in what went wrong with the code. Spoiler below:

The thing is, no matter what value you input, you either will reach the first if (timeSincePree >=1 ), or you get to the last else statement if you entered for example, 0 or something negative.