How to format my answer?

Tell us what’s happening:
Describe your issue in detail here.
In my code, it appears I have it set up properly but I receive messages like"
golfScore(4, 4) should return the string Par" and I’m not sure how to resolve that? I understand the concept I just have trouble formatting the answer for the site to recognize it correctly
Your code so far

const names = ["Hole-in-one!", "Eagle", "Birdie", "Par", "Bogey", "Double Bogey", "Go Home!"];

function golfScore(par, strokes) {
// Only change code below this line
if (strokes == 1){
return "Hole-in-one!";
} else if ( strokes <= par -2){
return "Eagle";
} else if ( strokes === par -1){
return "Birdie";
}else if (storkes === par){
  return "Par";
}else if (strokes === par + 1){
  return "Bogey";
}else if (strokes === par + 2){
  return "Double Bogey";
}else if ( strokes >= par + 3){
  return "Go Home!";
  return "change me!";

// Only change code above this line

golfScore(5, 4);

  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36

Challenge: Golf Code

Link to the challenge:


When you get this message, your first instinct should be to start debugging that specific case. The first thing I would do is add the following line after the function definition:

console.log(golfScore(4, 4))

Doing so gives this helpful error message:

ReferenceError: storkes is not defined

1 Like

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