When deciding on which code style to use, under different circumstances (i.e. number of parameters, return value, etc.) a good solid rule for consistency and terseness is: Always use the minimum required syntax for the situation
The minimum does not include variable/parameter names, which should should be semantic to the meaning or general depending on how the function will be used. Using an unused parameter name to save one char (like _ => 2*2
) is confusing and should be avoided.
With this rule in mind we end up with this:
// no params
() => {} // "noop" no parameters, no operations, no return value
() => value + 1 // no parameters, one line operation, a return value (that is not an object)