Review JavaScript Fundamentals by Building a Gradebook App - Step 3

Tell us what’s happening:

I got stuck here,
suggest me please , i am new for coding

Your code so far

function getAverage(scores) {
  let sum = 0;

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

  return sum / scores.length;
}

function getGrade(score) {
  if (score === 100) {
    return "A++";
  } else if (score >= 90) {
    return "A";
  } else if (score >= 80) {
    return "B";
  } else if (score >= 70) {
    return "C";
  } else if (score >= 60) {
    return "D";
  } else {
    return "F";
  }
}


// User Editable Region

function hasPassingGrade(score) {if(getGrade=="F"){
  return 'False'
}else
  return'True';
}
  



console.log(hasPassingGrade(100));
console.log(hasPassingGrade(53));
console.log(hasPassingGrade(87));

// 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/125.0.0.0 Safari/537.36

Challenge Information:

Review JavaScript Fundamentals by Building a Gradebook App - Step 3
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/review-js-fundamentals-by-building-a-gradebook-app/step-3`Preformatted text`

So, this is what you need to do.
Your getGrade function should include the score parameter so that it takes the argument in the hasPassingGrade function call in the console log function.

Also, what you have as your return values are not booleans but rather strings, get rid of the quotation marks and change the casing of the first letters to lower, that’s how we write the false and true keywords properly.

sorry what is meaning of score parameter

A parameter is a variable stored inside a function.
The score parameter is what is inside the brackets.

1 Like

i am still stuck
function hasPassingGrade(score) {if(getGrade(score)=‘F’){
return false;
}else {
return true;
}

}

Check the operator that you used, you used an assignment operator, but that’s not the operator to use.

1 Like

i can understand what i am missing,
here is my code again.

function hasPassingGrade(score) {if(getGrade(score)=‘F’){
return true;
}
else if(getGrade(score)!=‘F’){
return false;
}

}

what is the difference between the assignment and the comparison operator?

1 Like

ahh i got it , thank you