Multiple Conditional (Ternary) Operators - Golf Code

Struggling to understand why the code is able to return ‘Eagle’
when passed golfScore(4, 2)
but not golfScore(5, 2) ?
Any help is much appreciated!

Welcome, alistair.
You can see that your condition for returning "Eagle" is:

strokes === par - 2

So, if par === 5 and strokes === 2,

strokes !== par - 2

For future posts, if you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Thanks XD ! Little bit of logic would’ve gone a long way there. Time to take a break i rate!