Build a Gradebook App - Build a Gradebook App

Tell us what’s happening:

Not sure what is going on here, but i am not able to pass the requirements outlined in step for, e.g., the studentMsg function. My code produces the desired outputs as outlined in the tests section, (Class Average, Your grade, passing not passing), yet my code does not pass. Any assistance would be greatly appreciated. Thank in advance!

Your code so far

const getAverage = (arr) => {
  let totalScore = 0
  let average = 0
  for(let i = 0; i < arr.length; i++){
    totalScore += arr[i]
  }
  average = totalScore / arr.length
  return average

}
const studentScore = getAverage;
const getGrade = (studentScore) => {
  switch(true){
    case (studentScore === 100):
      return "A+"
      break;
    case (studentScore >= 90):
      return "A"
      break;
    case (studentScore >= 80):
      return "B"
      break;
    case (studentScore >= 70):
      return "C"
      break;
    case (studentScore >= 60):
      return "D"
      break;
    case (studentScore <= 59):
      return "F"
      break;
  }
}

const hasPassingGrade = (score) => {
  let grade = getGrade(score)
  if(grade === "F"){
    return false
  } else {
    return true
  }
}

const studentMsg = (arr, studentScore) => {
  let classAverage = getAverage(arr);
  let studentGrade = getGrade(studentScore);
  let passing = hasPassingGrade;
  if(passing = true){
    return `Class average: ${classAverage} Your grade: ${studentGrade}. You passed the course.`
  } else {
    return `Class average: ${classAverage}. Your grade: ${studentGrade}. You failed the course.` 
  }
}

console.log(studentMsg([12, 22, 32, 42, 52, 62, 72, 92], 85))
console.log(studentMsg([15, 25, 35, 45, 55, 60, 70, 60], 75))
console.log(studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100))
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/143.0.0.0 Safari/537.36

Challenge Information:

Build a Gradebook App - Build a Gradebook App

Welcome to the forum @daphnis1979 !

You have one typo (a missing dot) inside of the studentMsg arrow function.

Class average: 71.7. Your grade: F. You passed the course. - It should be not passed.
Do you want to take a look first or do you need some hint?

are you sure you are using the correct operator here?
do you need here the same operator that you use here?

or maybe a different operator?

How do you call a function? What argument do you need to pass to the function?