How can I access local scope dynamically in javascript?

To answer your question, no, there is no way to do dynamic variable lookup in a local scope without using eval().

The best alternative is to make your “scope” just a regular object [literal] (ie, "{}"), and stick your data in there.

Leave a Comment