You are viewing a single comment's thread. Return to all comments →
I think you can make it even shorter without hurting readability too badly.
return grades.map(g => (g < 38 || g%5 < 3) ? g : Math.ceil(g/5)*5)
This would work too and is probably a little clearer.
return grades.map(g => (g < 38 || g%5 < 3) ? g : g+(5-(g%5)))
Grading Students
You are viewing a single comment's thread. Return to all comments →
I think you can make it even shorter without hurting readability too badly.
This would work too and is probably a little clearer.