title: Where is my implementation of rot13 in JavaScript going wrong?
body: <p>Code in question with syntax highlighting here: <a href="http://friendpaste.com/7EbFwfzYSemBxmL2u5879f" rel="noreferrer">via Friendpaste</a></p>
  
  <p>rot13.js:</p>
  
  <blockquote>
    <p>ERRONEOUS</p>
  
  <pre><code>&lt;script&gt;
  String.prototype.rot13 = rot13 = function(s)
   {
      return (s = (s) ? s : this).split('').map(function(_)
       {
          if (!_.match(/[A-Za-z]/)) return _;
          c = Math.floor(_.charCodeAt(0) / 97);
          k = (_.toLowerCase().charCodeAt(0) - 96) % 26 + 13;
          return String.fromCharCode(k + ((c == 0) ? 64 : 96));
       }).join('');
   };
  &lt;/script&gt;
  </code></pre>
  </blockquote>
  
  <p>As you can see, using quite literally a single line to attach a method to the String object a la prototyping, I'm having a map() method that I previously set up (I know for sure that that code works perfectly; it's simply iterating over each element in the array and applying the function specified in the parameter) go over each character in a string and do what I thought were the proper calculations to transform the string into it's rot13'd counterpart. I was sadly mistaken. Can anybody spot where I went wrong?</p>