Could be more specific? I am not getting any syntax errors in the console. In addition, when I test for the scores (4,4) and (5,5) with console.log(golfScore(#,#)) they both return par. However, when I run my test I get an error saying my scores should return par.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
You can refer/search online or your course notes for the correct usage of the if-else construct. Note that the usage of the else towards the end of the if-else.
}else{ return "Go Home!"; }
I have fixed the syntax error, but still get the issue with my test run telling me my (4, 4) and (5,5) are not returning par. However, console.log says otherwise.
// running tests golfScore(4, 4) should return the string Par golfScore(5, 5) should return the string Par
The OP didn’t provide a link to the challenge but it can be deduced that the first number is the expected number of tries/swings someone makes for a specific hole while the second number is actual achieved number of tries. So for a hole that has 3 as the first parameter, if you get the ball in the hole in exactly 3 tries then you have achieved “par”.