1) codeSet is not a good function name, since it includes no verb
2) extracting a const variable makes the function call redudant
and shortens line 24 to be less than 80 characters wide
Technically, the % operator in JS is _not_ the modulo operator.
It's a different operator that returns negative values by design.
So it _does_ work with negative numbers as intended,
it's just not the operator that is needed for the caesar shift.
Therefore, mod does not "make % work with negative numbers",
it just uses % to implement the modulo operator.
The previous comment might suggest that there is a bug that gets fixed,
the new comment hopefully avoids that source of possible confusion.
Using shift as a parameter name might be confusing,
since it is a verb and therefore not a good variable name on its own.
Changing it to shiftValue should clear things up and also makes it
possible to shorten the name of the shiftChar function to just shift,
which leads to a cleaner signature: shift(char, shiftValue)