You are here: irt.org | About | Feedback | 2362 [ previous next ]
Feedback on:
irt.org FAQ Knowledge Base Q181
Sent by
Thor Larholm on February 14, 2001 at 01:34:08:
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])
Other feedback on 'irt.org FAQ Knowledge Base Q181' - show all