Returning a property from a function

T

Thomas K. Nielsen

Hi I have the following structure of namespaces

aa = {};
aa.bb = {};
aa.bb.aaList = function(int){};
aa.bb.aaList.prototype = {
aQuestion: function(id){
active = this.anArray[id] // settin the value of
active from an array I have built earlier
}
};

//----------------------------------------------------

Now I want to call my function

x = new aa.bb.aaList(50);
//x.aQuestion(10) // I can do this - but I want a way to return the
active property of the aQuestion function
like this :
x.aQuestion(10).active

How can I do that? Any suggestion? Thanks in advance
Thomas
 
S

scripts.contact

Thomas said:
x = new aa.bb.aaList(50);
//x.aQuestion(10) // I can do this - but I want a way to return the
active property of the aQuestion function
like this :
x.aQuestion(10).active

How can I do that? Any suggestion? Thanks in advance

in your function,return an object with active property :
return {active: whatever }
 

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

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,426
Latest member
MrMet

Latest Threads

Top