Subj : Re: Retrieve a variable value indirectly To : netscape.public.mozilla.jseng From : celso Date : Sat Oct 01 2005 05:10 am I think you want: var value = this[pointer] celso Olinda Spider wrote: > Is there a way in JavaScript to get the value of scope variable > determined via a dynmaically obtained variable name? > > For example, given the following JS code: > > var pointed = 'getme' > var pointer = 'pointed' > > // Now only using pointer, get the value it "points" to > > // What I am looking for is something like this: > var value = [pointer] > // doesn't work, you end up with 'pointeed', not 'getme' > > // this works! but is seems like an awfull lot of > // work to compile, execute, and run this. > var value = eval(pointer) > > > I sure hope I am missing something.... > > Thanks, > Pat .