Commit Graph

8 Commits

Author SHA1 Message Date
c-auri 7beb49e593 Inline codeSet and use const variable instead
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
2022-11-18 16:53:14 +01:00
c-auri b4909d27a3 Extract const variable for readability 2022-11-18 16:52:37 +01:00
c-auri a539c1776a Improve modulo comment
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.
2022-11-18 15:43:29 +01:00
c-auri 0d27422bc5 Change shift variable and function names
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)
2022-11-18 14:53:38 +01:00
Michael Frank 749a48adee Tweak matchers in removeFromArray, pull pigLatin solution from old branch 2021-04-30 22:12:52 +12:00
Étienne Boisseau-Sierra 00407bdee5 Transform 'let' in 'const' where needs be 2018-08-07 11:25:16 +01:00
Étienne Boisseau-Sierra 3a9251d55e Transform 'var' in 'let' 2018-08-07 11:25:16 +01:00
Cody Loyd b847c3bd61 add caesar cipher 2017-08-25 13:59:26 -05:00