On 07/07/2012, at 15:18, Angel Java Lopez wrote:
>
>
> (...) Apparently, my problem is: I didn't find a way to define a local var
> with a dynamic name. (...)
The only way to declare a local var dinamically is with eval():
var varName= "thisIsATest";
eval("var "+ varName+ "= 27");
console.log(thisIsATest, global.thisIsATest);
-> 27 undefined
But perhaps you should not do that because (I believe that) the mere presence
of eval() in a function will turn off most (all?) v8 optimizations... (me
thinks).
--
Jorge.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en