Here is my code
if (par==strokes){
return "Par"
} else if (strokes <= par-2){
return "Eagle"
} else if (strokes == par-1){
return "Birdie"
} else if (strokes == par+1){
return "Bogey"
} else if (strokes == par+2){
return "Double Bogey"
} else if (strokes >= par+3){
return "Go Home!"
} else if (strokes ==1 && par>=1){
return "Hole-in-one!"
}
The error I’m getting is
golfScore(4, 1) should return the string Hole-in-one!
golfScore(1, 1) should return the string Hole-in-one!
Where am I going wrong??
Edit: I switched the Hole in One else if with the Par if and the code worked.