Is this bad practice: getMyObject().method()
<p>Suppose I have a function which returns an object :</p>

<pre><code>getMyObject(){
   //do stuff here
   return object;
}
</code></pre>

<p>Is it bad practice to call a method (that doesn't return anything) on the function name itself:</p>

<pre><code>getMyObject().method();
</code></pre>

<p>instead of assigning a variable to the return object and then calling the method on that variable :</p>

<pre><code>var returnedObject = getMyObject();
returnedObject.method();
</code></pre>

<p>I am working with an html page that has many nested frames, and I have access to a function that returns one of these frames. The frame might be used several times within other functions in my script, and I was wondering if it would be ok for me to access the frame in the way asked above, or if it would be better to declare a global variable.</p>

<p>*<em>EDIT: *</em> Ahh I haven't gotten a chance to use jQuery.  Good to know! </p>
