Tell us what’s happening:
I cannot understand, and don’t have idea of how me finish that question
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 >= 1 && strokes === 1 ){
return names[0];
} else if(par >= 2 && strokes === 2 ) {
return names[1];
} else if (par >= 3 && strokes === 3){
return names[2];
} else if (par >= 4 && strokes >= 4){
return names[3];
} else if (par >= 4 && strokes === 5 ){
return names[4];
} else if (par >= 4 && strokes >= 6 ){
return names[6];
}
}
// Change these values to test
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/70.0.3538.102 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/golf-code