title: Caesar Cipher in Javascript
body: <p>I am trying to write a program to solve the following problem in javascript (Written below this paragraph). I don't know why my code isn't working. Could someone help me? I'm new to javascript; this is a free code camp question. </p>
  
  <p>"A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. Thus 'A' ↔ 'N', 'B' ↔ 'O' and so on.</p>
  
  <p>Write a function which takes a ROT13 encoded string as input and returns a decoded string."</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function rot13(str) { // LBH QVQ VG!
    
    var string = "";
    for(var i = 0; i &lt; str.length; i++) {
      var temp = str.charAt(i);
      if(temp !== " " || temp!== "!" || temp!== "?") {
         string += String.fromCharCode(13 + String.prototype.charCodeAt(temp));
      } else {
        string += temp;
      }
    }
    
    return string;
  }
  
  // Change the inputs below to test
  console.log(rot13("SERR PBQR PNZC")); //should decode to "FREE CODE CAMP"</code></pre>
  </div>
  </div>
  </p>