Caesars Cipher -Solved

Caesars Cipher -Solved
0.0 0


Can we solve the same in another way?


Try it and find out! Get used to exploring ideas in code rather than being told what you can and cannot do.

function rot13(str){
     wordA = 'A'.charCodeAt(0);
     wordN = 'N'.charCodeAt(0);
     wordZ = 'Z'.charCodeAt(0);
freshArr = [];
for (var i = 0;i<str.length;i++) {
    var word = str.charCodeAt(i);
    if(word >=wordN){
return freshArr.join("");
    console.log(rot13('SERR PBQR'));

Iā€™m almost done with this but my O/P has a ā€œ-ā€ in between.