How to access the String when creating a new method for String.prototype in javascript
<p>I'm trying to learn how to add new methods in the String.prototype in JavaScript. But I can't figure out a way on how to access the string specified in the new method:</p>

<pre><code>String.prototype.new_method = function(){ THE_STRING; };
</code></pre>

<p>So that it will return "abc" when I call it:</p>

<pre><code>"abc".new_method();
</code></pre>

<p>I know this can easily be done by doing:</p>

<pre><code>function returnstring(str){
   return str;
}
</code></pre>

<p>But I really want to learn how prototypes in JavaScript works.</p>
