Feedback on: irt.org FAQ Knowledge Base Q181
Worth:
Very worth reading
Comments:
It helped me great with creating variable names at runtime.
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])