getGrade is a function, you are not using it correctly
here you are comparing a function with a string, this is always false
when you separate expressions like this with the comma, the value of the total expression is that of the last expression, see comma operator for more info.
that means this is equivalent to if ("D") {}, a string is truthy, so this executes, making so that you always return true.
here you are also comparing a function with a string, this is always false
Hey thanks for the help.
I’m still stuck tho. I get the comma problem so I removed it, and I also removed the “” so it would not be a string anymore, but I have no success yet.
Functions need to be called with parantheses (). Example: myFunction() would call the function named myFunction, that does not have taken any arguments. To call a function with an argument, place it inside the parantheses, myFunction(argument).
The single equal sign = is the assignment operator. Here you are trying to assign the string “A” to a variable called getGrade. You should use === in this context.