Tell us what’s happening:
Describe your issue in detail the test data has par = 5 shots = 2 and says the correct output should be “Eagle” this is wrong. An eagle is 2 under par the test data gives 3 under par which is not an eagle.
**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
let retValue ;
if (strokes == 1){
retValue = 0;
} else if (par + 2 < strokes){
retValue = 6;
} else{
retValue = 3 - (par - strokes);
}
return names[retValue];
// Only change code above this line
}
golfScore(5, 4);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36
Challenge: Golf Code
Link to the challenge: