Hi, i’m in the third challenge, i’m watching the console output and it fits the expected results, i don’t get it, why am getting errors?
Thanks in advance.
function rot13(str) {
let arr = [];
let rot = '';
for (let i = 0; i < str.length; i++){
if (str.charCodeAt(i) < 65){
arr += str.charCodeAt(i) + ' ';
} else if (str.charCodeAt(i) < 78){
arr += str.charCodeAt(i) + 13 + ' ';
} else {
arr += str.charCodeAt(i) - 13 + ' ';
}
}
arr = arr.split(" ");
for (let i = 0; i < arr.length; i++){
rot += String.fromCharCode(arr[i]);
}
console.log(rot);
return rot;
}
rot13("SERR CVMMN!");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36 Edg/91.0.864.48
Challenge: Caesars Cipher
Link to the challenge: