Tell us what’s happening:
I’m a bit confused about the Golf code challenge, can i get a reference of a full explanation of the Golf code challenge.
Your code so far
var names = ["Hole-in-one!", "Eagle", "Birdie", "Par", "Bogey", "Double Bogey", "Go Home!"];
function golfScore(par, strokes) {
// Only change code below this line
if(par <= 4 strokes == 1){return "Hole-in-one!"}
else if(par <= 4 strokes == 2){return "Eagle"}
else if(par <= 5 strokes == 2){return "Eagle"}
else if(par <= 4 strokes == 3){return "Birdie"}
else if(par <= 4 strokes == 4){return "Par"}
else if(par == 1 strokes == 1){return "Hole-in-one!"}
return "Change Me";
// Only change code above this line
}
golfScore(5, 4);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0
.
Challenge: Golf Code
Link to the challenge: