I am receiving errors and I am not able to watch the video on freeCodeCamp
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];
}
return "Change Me";
// Only change code above this line
}
golfScore(5, 4);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15.
Can’t help concerning the video, sorry, but as for the error, you don’t need eagle eyes because JavaScript will help you with that
I ran your code in the challenge and this was the error message:
You’ll really benefit from reading the error messages closely and trying to understand what they mean. In this case, a Syntax Error means that JavaScript stumbled upon something that it doesn’t know (often, that’s a spelling mistake, or a missing bracket/curly brace), and it also tells you which line caused the error (4 in this case). From there, it’s not too difficult to spot the problem.