Skip to content

Commit ab9ba90

Browse files
Update CaesarCipher.js
1 parent 2bce949 commit ab9ba90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: Ciphers/CaesarCipher.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ const caesarCipher = (str, rotation, alphabet = 'abcdefghijklmnopqrstuvwxyz') =>
3232
if (cipherMap.has(lowerChar)) {
3333
const cipheredChar = cipherMap.get(lowerChar);
3434
return isUpperCase ? cipheredChar.toUpperCase() : cipheredChar;
35-
}
35+
}
36+
37+
return cipherMap.get(char);
38+
});
3639

37-
// Return non-alphabetic characters unchanged
38-
return char;
39-
});
4040
};
4141

4242
// Example usage:

0 commit comments

Comments
 (0)