FCC: Caesars Cipher - https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-caesars-cipher/16003

Challenge link: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher
for challenge guide: freeCodeCamp Challenge Guide: Caesars Cipher

Solution
function rot13(str) {
  let newStr = [];
  let letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

  for(let i = 0; i < str.length; i++){
    (/\W/.test(str[i])) 
      ? newStr.push(str[i])
      : (letters[letters.indexOf(str[i]) + 13]) 
      ? newStr.push(str[i].replace(str[i], letters[letters.indexOf(str[i]) + 13]))
      : newStr.push(str[i].replace(str[i], letters[letters.indexOf(str[i]) - 13]))
  }
  return newStr.join("");
}

Tried doing the challenge without String.charCodeAt() or String.fromCharCode() hope this helps.

Thank you for your guide post contribution. Unfortunately, we will not be including it in the guide post at this time.

We look forward to your further contribution.