Jun 7, 2021
A LOT of these are stunning examples of "variables for nothing". Also whilst I realize these are just demo's, they're also typical examples of the "functions for nothing" as well, something painfully common to people who go absolute batshit nutters over-the-top with "functional programming".
Also great examples of when ternary and loose typecasting for boolean are your friend.
return value % 5 ? ( value === 7 ? "B" : "C" ) : "A";
Or the generateStystemCodeFromFunctionNAmeTooBlastedLong
Why are you making constants for NOTHING? Especially since you could re-use the parameters in scope.
function generateSystemCodeFromBaseValue({value = 1, multiplier = 3}) {
value *= multiplier;
return [ getCategoryForValue(value), value ];
}