I’ve tried a few different ways but can’t seem to get my hasPassingGrade function to work properly
You should have a function named hasPassingGrade.
Failed:17. Your hasPassingGrade function should return a boolean value.
Failed:18. Your hasPassingGrade function should return true if the grade is an “A”.
Failed:19. Your hasPassingGrade function should return false if the grade is an “F”.
Failed:20. Your hasPassingGrade function should return true for all passing grades.
I got rid of the console logs and it did fix things. My hasPassingGrade only seems to return false even when I tried to change it though. That seems to be the last thing I’m stuck on
Failed:18. Your hasPassingGrade function should return true if the grade is an "A".
Passed:19. Your hasPassingGrade function should return false if the grade is an "F".
Failed:20. Your hasPassingGrade function should return true for all passing grades.
studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37) should return the following message: "Class average: 71.7. Your grade: F. You failed the course." .
This is the only one left so I just have to find out why F isn’t equaling false. I tried inputting an “if” statement to resolve it but it only made more tests fail
Look at the operator you are using in your condition. What is that operator used for? What operator should be used instead to test for equality? But since hasPassingGrade returns a boolean, do you even need an operator?
The operator you used is to assign a value to a variable. The operator you need to use, if you use an operator at all, would be to test for equality. Do you remember what that is?
use console.log to test the result of your condition and test it with different input.
Something like this:
console.log(studentScore, hasPassingGrade,hasPassingGrade = true)
if (hasPassingGrade = true) {
This way you can see how different input is going to be evaluated by your if statement. Reduce any mysteries by using console.log() to see the operation of your program.
Also, what is hasPassingGrade? Is that a variable?