Extract const variable for readability

This commit is contained in:
c-auri 2022-11-18 16:16:41 +01:00
parent a539c1776a
commit b4909d27a3
1 changed files with 2 additions and 3 deletions

View File

@ -17,9 +17,8 @@ const shift = (char, shiftValue) => {
const code = char.charCodeAt(); const code = char.charCodeAt();
if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122)) { if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122)) {
return String.fromCharCode( const shiftedCode = mod(code + shiftValue - codeSet(code), 26) + codeSet(code);
mod(code + shiftValue - codeSet(code), 26) + codeSet(code) return String.fromCharCode(shiftedCode);
);
} }
return char; return char;
}; };