In short, my results are baffling even though I think the output is correct.
As a new user, I couldn’t paste more than one screenshot, so I kluged them together into a single image. I hope that works out :-
In short, my results are baffling even though I think the output is correct.
As a new user, I couldn’t paste more than one screenshot, so I kluged them together into a single image. I hope that works out :-
I just noticed that there’s a missing period after Class Average and fixed it. Same strange result (albeit with 5 new periods.)
Please post your code instead of a screenshot. Thanks
Got it. Here you go:
function studentMsg(totalScores, studentScore) {
if (hasPassingGrade(studentScore)) {
console.log("Class average: " + getAverage(totalScores) + ". Your grade: " + getGrade(studentScore) + ". You passed the course.");
}
else
{
console.log("Class average: " + getAverage(totalScores) + ". Your grade: " + getGrade(studentScore) + ". You failed the course.");
}
}
console.log(studentMsg([92, 88, 12, 77, 57, 100, 67, 38, 97, 89], 37));
console.log(studentMsg([56, 23, 89, 42, 75, 11, 68, 34, 91, 19], 100));
Note - a console.log
does not return anything
there are undefined
in your console, can you figure out where those come from? they are your issue
I got it, thank you!
I’m not sure if this is a common error, but it may be helpful to include this ‘return’ directive among the bulleted tips, e.g. “Remember to return the message instead of logging it within the function itself.”
I don’t think that’s good thing to include. Most learners remember it, and the more we include, the less people read. Also, people can click on the help button if they get stuck
Fair enough. If I’m the rare bird who gets this wrong, no need to confuse everyone else with it.
discussing with a collegue, the wording of the “Your function call” will be changed to avoid saying “Your”
thank you for your feedback