jQuery functions retrieving and passing data
<p>If I have a function in jQuery that holds some values:</p>

<pre><code>(function ($) {
    $.fn.myFunction = function() {
        var option1 = 'green';
        var option2 = 'green';
        var option3 = 'green';
        return option1, option2, option3;
    }

    $.fn.myFunction2 = function(option1, option2, option3) {
    }
}) (jQuery); 
</code></pre>

<p>If I wanted to pass the data from <code>myFunction</code> to <code>myFunction2</code>, how do I achieve it? And if I was to call the script in the following manner <code>var data = $('div').myFunction();</code> how do I get access to each <code>option</code>?</p>

<p>Reading through a few books on the subject but its not being explained that well.</p>

<p>EDIT:</p>

<p>I would want to use the returned data in the following way:</p>

<pre><code>var options = $('article').myFunction(); 
$('article').myFunction2(options);
</code></pre>

<p>but I would also like to be able to pull out individual items</p>

<pre><code>var options = $('article').myFunction();
$('article').myFunction2(options[option2]);
</code></pre>
