Hello list
here is the thing i have simple object :
------------------------------------------------
function struct()
{
this.v_name;
this.next_obj;
}
no in the body i have something like this:
------------------------------------------------
var p=new struct();
var q=new struct();
var z=new struct();
p.v_name="blah_p";
q.v_name="blah_q";
z.v_name="blah_z";
z.next_obj=null;
q.next_obj=z;
p.next_obj=q;
-----------------------------------------------
my question is , is there any way to loop throw the objects hierarchy to check every object v_name value. in other words to automate the process of checking manually like this :
p.next_obj.next_obj.v_name .....and so on ..
to build some kind of function to loop throw the first "p" object .next_obj property
and alert every .v_name along the way..
hope you got my point here
thanks!
here is the thing i have simple object :
------------------------------------------------
function struct()
{
this.v_name;
this.next_obj;
}
no in the body i have something like this:
------------------------------------------------
var p=new struct();
var q=new struct();
var z=new struct();
p.v_name="blah_p";
q.v_name="blah_q";
z.v_name="blah_z";
z.next_obj=null;
q.next_obj=z;
p.next_obj=q;
-----------------------------------------------
my question is , is there any way to loop throw the objects hierarchy to check every object v_name value. in other words to automate the process of checking manually like this :
p.next_obj.next_obj.v_name .....and so on ..
to build some kind of function to loop throw the first "p" object .next_obj property
and alert every .v_name along the way..
hope you got my point here
thanks!
Comment