function rot13(str) {
let Arr1 = str.split('');
let cCode = Arr1.charCodeAt(0);
let result=[];
for(let i=0;i<cCode.length;i++){
if(cCode[i]<65 || cCode[i]>90){
result.push(fromCharcterCode(cCode[i]));
}
if(cCode<78){
result.push(fromCharacterCode(cCode[i]+13));
}
else{
result.push(fromCharacterCode(cCode[i]-13));
}
}
return result.join('');
}
rot13("SERR PBQR PNZC");
I don’t think that this is actually an array.
It would help if you describe what you think that your code is doing.
I thought characterCodeAt(0) going to convert all the array into Unicode, but it only converted the first index, thanks