Commit Graph

6 Commits

Author SHA1 Message Date
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