I am doing the Caesars Cipher challenge.
I believe my code should be working but I am getting an error I don’t understand. I get 12 red dots.
Here is my code
function rot13(str) {
//str = str.split('');
var arr = [];
// var regex = /[^a-zA-Z]/g;
for (var i = 0; i < str.length; i++){
if (str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 77){
arr.push(String.fromCharCode(str.charCodeAt[i] += 13));
}else if(str.charCodeAt(i) >= 78 && str.charCodeAt(i) <= 90){
arr.push(String.fromCharCode(str.charCodeAt[i] -= 13));
}else if (str.charCodeAt(i) < 65){
arr.push(str[i]);
}
}
return arr.join('');
}
rot13("SERR PBQR PNZC");