I see you in your studentMsg function you use totalScores and studentScore as arguments, but I’m not seeing them defined as a variable or function anywhere else in your code before that.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
you must remove studentScore here, or things will not work. studentScore doesn’t exist outside of studentMsg, and your code and the tests stop working. If you don’t do this nothing else matters.
After that
let’s do some debugging:
Your function call of studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37) should return the following message: "Class average: 71.7. Your grade: F. You failed the course." .
So let’s compare:
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));
console.log("Class average: 71.7. Your grade: F. You failed the course.");
this prints to the console:
Class Average: 71.7 Your Grade: F You failed the course.
Class average: 71.7. Your grade: F. You failed the course.
Your code has some errors, the string needs to match exactly