classMember within classFunction theory question

E

ed

Question about the following example code:
 
var something = {
 
            classMemberObjRef : null,
 
            randomOperation : function() {
 
                        var localObjRef = something.classMemberObjRef;
 
                        ...
            }
        
         secondOperation : function() {
                  
                   var localObjRef = something.classMemberObjRef;
 
                   ...   
         }
}
 
 
I've seen this a few times, and am not sure what the need is to create
localObjRef for each function.  Is this a simply a best practice, or is
there something else to it? Is there some sort of scoping issue that
will prevent direct access to something.classMemeberObjRef?  Will it
vary per-function?  Just looking for some info I can't find in my books....
 
E

ed

Sorry, I don't know what I was thinking... classMemberObjRef, pretend
it is set to something OTHER than null!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,420
Latest member
ZitaVos505

Latest Threads

Top