howie_
12 years agoContributor
JScript nested functions
Hello,
I'm trying to approximate a "class" in jscript, with member functions. I'd like to do something like the code below. Does anyone know if it's possible?
function Thing()
{
this.Items = new Array("10", "20", "30");
function Find(item)
{
//search Items for "item"
}
}
var thing = new Thing();
thing.Find("10");
I'm trying to approximate a "class" in jscript, with member functions. I'd like to do something like the code below. Does anyone know if it's possible?
function Thing()
{
this.Items = new Array("10", "20", "30");
function Find(item)
{
//search Items for "item"
}
}
var thing = new Thing();
thing.Find("10");