Tell us what’s happening:
My code is not working please tell me whats wrong ?
Your code so far
function rot13(str) { // LBH QVQ VG
var a=[];
for(i=0;i<str.length;i++){
if(str.charCodeAt(i) < 65 || str.charCodeAt(i) > 90)
return a.push(str.charCodeAt[i]);
else if(str.charCodeAt(i)>77)
return a.push(String.fromCharCode(str.charCodeAt(i)-13));
else
return a.push(String.fromCharCode(str.charCodeAt(i)+13));
}
return a.join("");
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
.
Link to the challenge: