I was trying to resolve the challenge, I figure out isn’t the best way but In my logic almost Works. I can’t find the "Logical " error in my code somebody could help me please.
Thanks in advance
In the conditional , below this line, show me error and I don’t Knwo why…
(par===4, strokes===5) { return "Bogey"
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 (par===1,strokes===1) { return "Hole-in-one!"
} else if
(par===4,strokes===1) { return "Hole-in-one!"
} else if
(par===4,strokes===2) { return "Eagle"
}else if
(par===5, strokes===2) { return "Birdie"
} else if
(par===4, strokes===3) { return "Birdie"
} else if
(par===4, strokes===4) { return "Par"
} else if
(par===5, strokes===5) { return "Par"
} else if
(par===4, strokes===5) { return "Bogey"
} else if
(par===4, strokes===6) { return "Double Bogey"
} else if
(par===4, strokes===7) { return "Go Home!"
} else if
(par===5, strokes===9) { return "Go Home!"
} else
return "Change Me";
// Only change code above this line
}
golfScore(4, 5);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
.
Challenge: Golf Code
Link to the challenge: