What did I do wrong?

I just started learning JavaScript and finished the first pyramid generator project and in the 3rd step of the project where you build a Grade-book app its says,

A passing grade is anything that is not an "F"(which is below 60 btw).
Complete the function hasPassingGrade that takes a student score as a parameter. Your function should return true if the student has a passing grade and false if they do not.

And this is the code I wrote,
function hasPassingGrade(score) {
score = score > 60;
return score;
}

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

And it did print true, false, true
But when I check my code, why is still saying, " Your hasPassingGrade function should return true for all passing grades." ?
Is it because it can take more than 100 as value or some other reason? Again Iā€™m a completely new to this

to fix your fucntion to return true for scores of 60 or greater, you should modify the condition to check score is more than or equal to 60 instead of score is greater than 60.

no, 60 is a pass, 59 is a fail

Ah, my mistake. This was a typo and I meant to say it was below 60

what code do you have now?

score > 59.
it passed. I mistook 60 as ā€˜Fā€™ instead of 59. Thanks for the help

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.