From: FAQ server on
-----------------------------------------------------------------------
FAQ Topic - When should I use eval?
-----------------------------------------------------------------------

The `eval` function should _only_ be used when it is necessary to
evaluate a string supplied or composed at run-time; the string
can be anything from a simple (but unpredictable) expression such
as `"12 * 2.54"` to a substantial piece of javascript code.

When `eval( '{"key" : 42}' )` is called, `{` is interpreted as a block of
code instead of an object literal. Hence, the Grouping Operator (parentheses)
is used to force `eval` to interpret the JSON as an object literal:
`eval( '({"key" : 42})' );`.

<URL: http://json.org/>
How do I access a property of an object using a string? [ref 1]
<URL: http://jibbering.com/faq/notes/square-brackets/>

References:
-----------

[1] http://jibbering.com/faq/#propertyAccessAgain


The complete comp.lang.javascript FAQ is at
http://jibbering.com/faq/

--

The sendings of these daily posts are proficiently hosted
by http://www.pair.com.