Caesars Cipher 'for loop and if statements'

Tell us what’s happening:

Your code so far

function rot13(str) { // LBH QVQ VG!
  charArr=[];  
  rot13CharArr=[];
  for (i=0; i<str.length; i++){
    charArr[i]=str.charCodeAt(i);  
  }
  charStr=charArr.join(); 
  
  for (i=0; i<charArr.length; i++) {
    if (64<charArr[i]<78){
        rot13CharArr[i]=String.fromCharCode(charArr[i]+13);
    }
    else if (77<charArr[i]<91) {
      rot13CharArr[i]=String.fromCharCode(charArr[i]-13);
    }
      else if (charArr<65 || charArr>90) {          
        rot13CharArr[i]=String.fromCharCode(charArr[i]);
      }
  }
     

  
  return rot13CharArr;
}

// 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/63.0.3239.132 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/caesars-cipher

Thank you for letting me know.

What should I search in MDN to find out more about these rules for comparatives in javascript?

Thank you for this. Finally able to complete this section with the below code.
I’m having trouble understanding why i cant use a range (i.e. a<var<b). Is it because it’s nested within an if statement? are there other cases when I have to use && and ||?

I know. I should really be searching this instead of asking :sweat:

Fantastic.
I understand it so much better now.
Couldn’t ask for a better explanation.