Rotate13 Texto em JavaScript

const rot13Deg = (string) => {
  var a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  var b = "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM";
  const newText = string.replace(/[a-z]/gi, (c) => b[a.indexOf(c)]);
  return newText
};
mrmalik610