Review js fundamentals by building a gradebook app - step 4

Hello, My code is outputting the correct answers yet I can’t seem to pass the stage.
What am I doing wrong?

function studentMsg(totalScores, studentScore) {
  if (hasPassingGrade(studentScore) == true) {
    console.log("Class average: " + getAverage(totalScores) + ". Your grade: " + getGrade(studentScore) + ". You passed the course.");
  } else {
    console.log("Class average: " + getAverage(totalScores) + ". Your grade: " + getGrade(studentScore) + ". You failed the course.");
  }
}
2 Likes

@WindWalker01 you have to share more info about which test and curriculum are you in Try to share the link to it here.

Step 4 of “Review js fundamentals by-building a gradebook app.”
Review JavaScript Fundamentals by Building a Gradebook App: Step 4 | freeCodeCamp.org

@WindWalker01 According to the console error you have to return them not console.log them (try to use return instead of console.log)

4 Likes

Thanks a bunch! You Rock!

1 Like

you need to return a string from the function rather than using a console.log. The function is already logged into the console so rather than if(){ console.log(…)}, you need to return the string using if(){return “…”}. Hope it helps

MOD Solution removed

Welcome to the forum @cristianalejandroqui

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.

good work, of course with after editing in return instead of having console.log