The value of the evaluated
code, if any.
eval( )was called illegally, through an identifier other than “eval”, for example. See the restrictions on this function described below.
- Other exception
eval( )generates an exception,
eval( )will pass that exception on to the caller.
eval( ) is a global method that evaluates a string
contains an expression,
eval evaluates the
expression and returns its value. If
eval( ) executes those statements and returns the value, if any,
returned by the last statement. If
does not return any value,
eval( ) returns
undefined. Finally, if
code throws an exception,
eval( ) passes that exception on to the caller.
eval( ) provides a very powerful capability to the
programs. Obvious uses are to write programs that act as recursive