Hello, I am a beginner, someone can help me understand the golf code well I do not know anything about golf, its becoming difficult for me to fully understand t

Tell us what’s happening:
Describe your issue in detail here.

  **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(strokes == 1){
  return names[0];
}else if(strokes <= par -2){
  return names[1];
}else if(strokes == par -1){
  return names[2];
}else if(strokes == par){
  return names[3];
}else if(strokes == par +1){
  return names[4];
}else if(strokes == par +2){
  return names[5];
}else if(strokes >= par + 3){
  return names[6];
}

return "Change Me";
// Only change code above this line
}

console.log(golfScore(4, 2));
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36

Challenge: Golf Code

Link to the challenge:

HI @stevencadeau0 !

Welcome to the forum!

As to your question, you don’t need to know anything about golf.
As long as you arrive at the correct answer then you can just move onto the next lesson.

Ok, thank you anyway I move on to the next one

I am also a beginner too. But you do not need to know anything about Golf.
I think they just want you to write code that compares par and strokes, and if the comparison matches the strokes equation, it would return something.

For fun, I used indexes to return the strings instead of typing them all out.

Hope this helps