Golf coding question

Tell us what’s happening:

I don’t Know if I have been looking at this for too long, but I don’t know why It shows undefined when I do the console.log part…
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 name[0];
} else if (strokes <= par - 2) {
return name[1];
} else if (strokes == par - 1) { 
return name[2];
} else if (strokes == par) {
return name[3];
} else if (strokes == par +1) {
return name[4];
} else if (strokes == par + 2) {
return name[5]
} else if (strokes >= par +3) {
return name[6];
}
// Only change code above this line
}

console.log(golfScore(4, 1))



Your browser information:

Challenge: Golf Code

Link to the challenge:

Never mind I just realized I forget an ‘s’ after names