Review JavaScript Fundamentals by Building a Gradebook App - Step 2

Tell us what’s happening:

Feel like I’m bashing my head through a wall here. I’m getting the correct grades back, but also with score itself and ‘undefined’

Your code so far

function getAverage(scores) {
  let sum = 0;

  for (const score of scores) {
    sum += score;
  }

  return sum / scores.length;
}

// User Editable Region

function getGrade(score) {
{
  const grade= score;{

if (grade === 100) 
  console.log("A++");
  }
   if (grade <= 99 && grade >= 90) {
   console.log("A")
  }
  else if (grade <= 89 && grade >=80) {
   console.log("B");
  }
  else if (grade <= 79 && grade >= 70){
   console.log("C");
}
  else if (grade <= 69 && grade >= 60){
   console.log("D");
  }
  else if (grade <= 59){
   console.log("F");
  }}
 return score;
}

console.log(getGrade(96));
console.log(getGrade(82));
console.log(getGrade(56));


// User Editable Region

Your browser information:

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

Challenge Information:

Review JavaScript Fundamentals by Building a Gradebook App - Step 2

you need to check your brackets, here you have three {, you should have only one, the one opening the function

missing the { of the if statement

you should have only one }

finally, you should return the grade

I’ve corrected all of these (thank you :slight_smile: ) But the code is still not passing. Should I reset or am I missing something else?

N/m figured it out. Thank you for your help!