Tell us what’s happening:
I am running the tests locally and they all seem to pass, but they do not pass in the app. What is wrong with my code?
**Your code so far**
function rot13(str) {
let arrayifiedString = str.split('');
for (var i = 0; i < arrayifiedString.length; i++) {
thisCharCode = getCharCode(arrayifiedString[i]);
console.log(thisCharCode);
if (isCapitalLetter(thisCharCode) === true) {
arrayifiedString[i] = getNewLetter(thisCharCode);
}
}
return arrayifiedString.join('');
function getCharCode(letter) {
return letter.charCodeAt(0);
}
function isCapitalLetter(letterCharCode) {
if (letterCharCode > 64 && letterCharCode < 91) {
return true;
}
return false;
}
function getNewLetter(charCode) {
if (charCode > 77) {
return String.fromCharCode(charCode - 13);
} else return String.fromCharCode(charCode + 13);
}
}
console.log(rot13('GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.'));
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36
Challenge: Caesars Cipher
Link to the challenge: