Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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])



Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.