I need help with Golf Code please

I need help with Golf Code please
0

#1

var 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 (strokes === 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”;
}

// Only change code above this line
}

// Change these values to test
golfScore(5, 4);


#2

Your code is almost correct, except two things,

  1. The quotes again

“Hole-in-one”

your quotes

"Hole-in-one"

normal one, are you in Mac, maybe you can adjust the settings
  1. “Hole-in-one!” see the sentence there is an exclamatory symbol at the end, similarly the case matters too, go through each of your return statements and check the case and those exclamatory symbols

#3

Yes, i have passed bro… Thanks a lot to you all God bless you all.