Caesars Cipher

function rot13(str) {
  // A-Z: 65-90
  let decoded = "";
  for (let i = 0; i < str.length; i++) {
    const code = str.charCodeAt(i);
    const shift = 0;
    if (code >= 65 && code <= 90) {
      shift = code + 13 > 90 ? -13 : 13;
    }
    decoded += String.fromCharCode(code + shift);
  }
  return decoded;
}

console.log(rot13("SERR CVMMN!"));

rot13("SERR PBQR PNZC") should decode to the string FREE CODE CAMP

rot13("SERR CVMMN!") should decode to the string FREE PIZZA!

rot13("SERR YBIR?") should decode to the string FREE LOVE?

rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") should decode to the string THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.