Libro de calificaciones

En js, en la creacion del libro de calificaciones en el paso 4, me pide crear una funcion que devuelva un mensaje. Ya tengo el codigo funcionando pero el curso no me lo acepta

Mi codigo:

function studentMsg(totalScores, studentScore) {
 let msg = "";

  hasPassingGrade(studentScore);

  if (studentScore === true) {
   msg = "You passed the course.";
  } else {
    msg = "You failed the course."
  }
  
  return "Class average: " + getAverage(totalScores) + ". Your grade: " + getGrade(studentScore) + " " + msg;

}
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Please use the ask for help button on the challenge you need help with, and not some random one. I updated the challenge link.


hasPassingGrade returns the boolean value true or false it does not cause any side effects, it does not change any variables.

studentScore is a number, not a boolean value.


If hasPassingGrade when passed studentScore returns true return the “passing message”, otherwise return the “failing message”.

1 Like

can you explain this line?

lo siento. Ya lo arregle. Ese codigo estaba mal. En cambio puse if (hasPassingGrade)