Golf Code: Problem with else if (strokes == (par +2))

Golf Code: Problem with else if (strokes == (par +2))
0

#1

Tell us what’s happening:

My cod should work for values (4,6). I don’t understand why Free Code Camp tells me I have an error!

The result in the console is “Double Bogey”, so I really don’t get it what Free Code Camp tells me I have an error with these values . A bug on the website?

Your code so far

function golfScore(par, strokes) {
  // Only change code below this line
  
  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!";
  }
  
}


golfScore(5, 4);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0.

Link to the challenge:


#2

Exclamation mark!!!


#3

What’s wrong with the explanation marks? They are strings inside of double quotes…


#4

Does "Double Bogey!" in the challenge description has one?


#5

The challenge instructions shows “Double Bogey” without an exclamation point at the end of it.

image