title: Unable to execute Doug Crockford's deentityify example in jsfiddle
body: <p>I am trying to execute that really nice deentityify example in Douglas Crockfords J-TBP book using jsfiddle </p>
  
  <pre><code>String.method('deentityify', function() {
      // The entity table. It maps entity names to
      // characters.
      var entity = {
          quot: '"',
          lt: '&lt;',
          gt: '&gt;'
      };
      // Return the deentityify method.
      return function() {
          // This is the deentityify method. It calls the string
          // replace method, looking for substrings that start
          // with '&amp;' and end with ';'. If the characters in
          // between are in the entity table, then replace the
          // entity with the character from the table. It uses
          // a regular expression (Chapter 7).
          return this.replace(/&amp;([^&amp;;]+);/g, function(a, b) {
              var r = entity[b];
              return typeof r === 'string' ? r : a;
          });
      };
  }());
  
  document.writeln('&amp;lt;&amp;quot;&amp;gt;'.deentityify()); // &lt;"&gt;          
  </code></pre>
  
  <ul>
  <li>see <a href="http://jsfiddle.net/cspeter8/7Pjzs/2/" rel="nofollow">http://jsfiddle.net/cspeter8/7Pjzs/2/</a> - and it does not work!  I would expect the results pane to display '&lt;">' but nothing shows up.  Would someone like to solve the mystery?  </li>
  </ul>