Javascript: passing parameters to object and function..?
<p>I'm sure this question has been answered before, but I don't think I'm using the right search phrase.</p>

<p>I think an example will explain better what I'm trying to ask:</p>

<pre><code>var test = {};
test.example = function(parameter_2){
    alert(parameter_1+parameter_2);
}
test("parameter_1").example("parameter_2");
</code></pre>

<p>Obviously that last line won't work.  Essentially wanting to do something like jQuery does with selectors, but just a little more archaic.</p>

<p>I'll probably just pass both parameters into the example(p1,p2) function.</p>

<p>It just sort of sparked my curiosity.</p>

<p>I found this: <a href="http://enterprisejquery.com/2010/08/javascript-parameter-patterns-with-extend-and-beyond/" rel="nofollow">http://enterprisejquery.com/2010/08/javascript-parameter-patterns-with-extend-and-beyond/</a> but I don't think it quite answered my question.  </p>
