Golf Code Probleme

hey guys , i reached the Golf Code , and somehow im right but i don’t know where is the problem here’s my code :

function golfScore(par, strokes) {
  if (strokes === 1) {
    return "Hole-in-one!";
  }

  if (strokes <= par - 2) {
    return "Eagle";
  }

  if (strokes === par - 1) {
    return "Birdie";
  }

  if (strokes === par) {
    return "Par";
  }

  if (strokes === par + 1) {
    return "Bogey";
  }

  if(strokes === par + 2) {
    return "Double Bogey";
  }

  return "Go Home!";
}

No problems with your posted code. You may want to try refresh the page and running the tests again.

i did so many times ,
but it returns

golfScore(4, 1)

should return “Hole-in-one!”

golfScore(4, 2)

should return “Eagle”

golfScore(5, 2)

should return “Eagle”

golfScore(4, 3)

should return “Birdie”

golfScore(4, 4)

should return “Par”

golfScore(1, 1)

should return “Hole-in-one!”

golfScore(5, 5)

should return “Par”

golfScore(4, 5)

should return “Bogey”

golfScore(4, 6)

should return “Double Bogey”

golfScore(4, 7)

should return “Go Home!”

golfScore(5, 9)

should return "Go Home!

What browser are you using? Also, if you look at the browser console (Ctrl+Shft+J in Chrome), do you see any errors? Please post a screenshot if you do.


well here it is

With the console open, click the clear button (top 2nd left icon in the console) and the click Run Tests again and then take a screenshot. I just want to make sure the console errors you are showing above were not caused after Run Tests is clicked and not for some other reason.

Hey again , well i did what u asked and yes you are right , after clearing it and running the test again , the console still clean , but always facing same issue

Try to login in incognito mode of your browser and run the code.
Note: Please copy your code.

well i tried that too , but it’s not working also

@Ojadox What browser are you using?

@Ojadox Remove all doublequote in your code. I think the error is you are copying the string from left side panel with quote and these quote is not supported in js. so remove all double quote and place it with single or doublequote with keyboard.
Give it another try.
If this is not the problem then make a codepen link. I will check.