re: Daily Challenge #68 - Grade Book VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Too much ternary operators... const grade = (a,b,c) =>{ const mean = (a + b + c) / 3; const prefix = mean % 10 < 5 ? '-': ...
 

You could use something like that:

({"-1": "-", "1": "+", "0": ""})[mean.toString().localeCompare("5")]

Not tested but I believe it would work in JavaScript.

code of conduct - report abuse