finalGrade() in JS Code Challenges

Hi guys, please help with the below challenge, I cant seem to move to the next challenge despite the fact that it does run when I console log. Am I missing something or is it because i disnt use the name of the parameters they use?

const finalGrade = (math,econ2,finance) => {

if ((math < 0 || math > 100) || (econ2 < 0 || econ2 > 100) || (finance < 0 || finance > 100 )

) {

return ‘You have entered an invalid grade’

}

const average = ((math + econ2 + finance) / 3);

if (average >=0 && average <= 59){

return 'F';

} else if ( average >= 60 && average <= 69){

return 'D';

} else if (average >= 70 && average <= 79){

return 'C';

} else if (average >= 80 && average <=89 ){

return 'B';

} else if (average >=90 && average <= 100){

return 'A';

}

};

console.log(finalGrade(100,70,80));

Hello! Could you please post a link to the exercise you’re doing? Also, to format code, press this button:


and put the code between the back ticks:Screen Shot 2020-05-02 at 14.06.13

2 Likes