Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: irt.org FAQ Knowledge Base Q181

Feedback on: irt.org FAQ Knowledge Base Q181

Sent by geert_lauwers@hotmail.com on February 04, 2001 at 06:34:41: - feedback #2328

Worth:
Very worth reading

Comments:
It helped me great with creating variable names at runtime.


Sent by Thor Larholm on February 14, 2001 at 01:34:08: - feedback #2362

Technical:
Not technical enough

Comments:
There is no need to use eval() when dynamically constructing objects. The only action that is needed is to reference the Global object. In the browser, the Global object is the window object, in all other implementations it is the this object (when outside any function and in the Global scope). Therefor:

var a = 'nameToNewVar';
this[a] = "value";
alert(this[a])


©2018 Martin Webb