contents   index   previous   next



global.eval()

syntax:

eval(expression)

where:

expression - a valid expression to be parsed and treated as if it were code or script.

 

return:

value - the result of the evaluation of expression as code.

 

description:

Evaluates whatever is represented by the parameter expression. If expression is not a string, it will be returned. For example, calling eval(5) returns the value 5.

 

If expression is a string, the interpreter tries to interpret the string as if it were JavaScript code. If successful, the method returns the last variable with which was working, for example, the return variable. If the method is not successful, it returns the special value, undefined.

 

see:

SElib.interpret()

 

example:

var a = "who";

   // Displays the string as is

Screen.writeln('a == "who"');

   // Evaluates the contents of the string as code,

   // and displays "true",

   // the result of the evaluation

Screen.writeln(eval('a == "who"'));

 


global.isFinite()