When I try to run the code in the /learn code editor, the tests don't seem to run

I’m using the google browser and i’ve cleared all the cookies and cache but whenever I try to run the code i’m not getting a response so i’m unable to know where i’ve gone wrong with the code. Please help, I’ve put alot of time into this.

Its really hard for us to guess what is happening without any code or information about which challenge you are working on.

I’m on the golf code course under Javascript curriculum. Apologies, I thought the title of the query plus explanation of the steps i’ve taken would be enough.

What code do you have?

Apologies, I lost it from all the refreshing and login out and in. Appreciate the quick response. My code is:

function golfScore(par, strokes) {
  // Only change code below this line
  if (par == 1)
} else if (par <= par - 2)
} else if (par == par - 1)
  return [2]
  } else if (par == par)
  return [3]
  } else if (par == par + 1)
  return [4]
  } else if (par == par + 2)
  return [5]
  } else (par >= par + 3)
  return [6]


  // Only change code above this line

This is invalid syntax. You should see a bunch of red squiggles on your screen. Those squiggles indicate that your browser doesn’t understand what you wrote.

I’m getting those lines under ‘else’ and ‘}’. Even the help video has those inputted. I’m not sure what to do?

You should fix this line:

Also, you have mismatched {}s around your if clauses:

There is no opening {

I’ve wasted your time. There was so much of it I messed up. Thank you, i’ll learn from this.

It isn’t a waste at all! We all make mistakes. It is part of the learning process!

Great work on the response time, much appreciated. Have a good day.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.