Tell us what’s happening:
This is my code, it works fine, but I do not know why it gives the error to the validation
Your code so far
function golfScore(par, strokes) {
// Only change code below this line
if(par > 0 || strokes > 0) {
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!";
}
} else {
return "Strokes and Par always positiv";
}
// Only change code above this line
}
// Change these values to test
golfScore(4, 1);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
.
Link to the challenge:
https://www.freecodecamp.org/challenges/golf-code