Apply a function to a variable? JavaScript/jQuery
<p>For example</p>

<pre><code>var contents = 'some text';

function fileSave(path){
// I'll handle saving the file, but I need the file contents
}

contents.fileSave('index.html');
</code></pre>

<p>So when the function is fun on the contents variable, the function has access to the variable. Like how replace() works in JavaScript.</p>

<p>EX.</p>

<pre><code>str.replace();
</code></pre>

<p>but in this case</p>

<pre><code>contents.fileSave();
</code></pre>

<p>the variable is interchangeable, the function applies to any variable is attached too.</p>

<p>Sorry, newbie..</p>
