You are viewing a single comment's thread. Return to all comments →
Using Ternary Operator
function getGrade(score) { // Write your code here
return (score>25 && score<=30)?'A':(score>20 && score<=25)?'B':(score>15 && score<=20)?'C':(score>10 && score<=15)?'D':(score>5 && score<=10)?'E':'F';
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Conditional Statements: If-Else
You are viewing a single comment's thread. Return to all comments →
Using Ternary Operator
function getGrade(score) { // Write your code here
}